pax_global_header00006660000000000000000000000064146135613200014513gustar00rootroot0000000000000052 comment=f5c5b378a21e3628fc6a999e4f0b09166826ac25 sphinx-sitemap-2.6.0/000077500000000000000000000000001461356132000144715ustar00rootroot00000000000000sphinx-sitemap-2.6.0/.github/000077500000000000000000000000001461356132000160315ustar00rootroot00000000000000sphinx-sitemap-2.6.0/.github/FUNDING.yml000066400000000000000000000013401461356132000176440ustar00rootroot00000000000000# These are supported funding model platforms github: [jdillard] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] sphinx-sitemap-2.6.0/.github/dependabot.yml000066400000000000000000000012241461356132000206600ustar00rootroot00000000000000# To get started with Dependabot version updates, you'll need to specify which # package ecosystems to update and where the package manifests are located. # Please see the documentation for all configuration options: # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" directory: "/" # Location of package manifests schedule: interval: "monthly" groups: # Name for the group, which will be used in PR titles and branch names all-github-actions: # Group all updates together patterns: - "*" sphinx-sitemap-2.6.0/.github/workflows/000077500000000000000000000000001461356132000200665ustar00rootroot00000000000000sphinx-sitemap-2.6.0/.github/workflows/continuous-integration.yml000066400000000000000000000041421461356132000253410ustar00rootroot00000000000000 name: continuous-integration on: push: branches: [master] tags: - "v[0-9]+.[0-9]+.[0-9]+*" pull_request: jobs: pre-commit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Set up Python 3.10 uses: actions/setup-python@v5 with: python-version: "3.10" - uses: pre-commit/action@v3.0.1 tests: runs-on: ubuntu-latest strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] sphinx-version: [''] include: - python-version: '3.12' sphinx-version: 'dev' - python-version: '3.11' sphinx-version: '7' - python-version: '3.10' sphinx-version: '6' - python-version: '3.9' sphinx-version: '5' - python-version: '3.8' sphinx-version: '5' steps: - uses: actions/checkout@v4 - name: Setup Python versions uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install Python dependencies run: | set -eo pipefail if [[ "${{ matrix.sphinx-version }}" != "" ]]; then if [[ "${{ matrix.sphinx-version }}" == "dev" ]]; then SPHINX_INSTALL="git+https://github.com/sphinx-doc/sphinx.git" else SPHINX_INSTALL="sphinx==${{ matrix.sphinx-version }}.*" fi fi set -x python -VV python -m site python -m pip install --upgrade pip setuptools wheel pip install -r requirements_dev.txt $SPHINX_INSTALL - name: Install Package run: | python -m pip install . - name: Run Tests for ${{ matrix.python-version }} run: | python -m tox vale: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: errata-ai/vale-action@reviewdog env: GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} with: files: docs # github-pr-check, github-pr-review, github-check reporter: github-pr-check sphinx-sitemap-2.6.0/.gitignore000066400000000000000000000003611461356132000164610ustar00rootroot00000000000000*.pyc .idea/ *.code-workspace # Unit test / coverage reports .tox # Distribution / packaging *.egg-info/ dist/ build/ # Environments .venv # Sphinx documentation docs/_build/ # vale packages docs/_vale/Microsoft/ docs/_vale/write-good/ sphinx-sitemap-2.6.0/.pre-commit-config.yaml000066400000000000000000000010031461356132000207440ustar00rootroot00000000000000# Install pre-commit hooks via # pre-commit install repos: - repo: https://github.com/PyCQA/isort rev: 5.13.2 hooks: - id: isort - repo: https://github.com/psf/black rev: 24.4.0 hooks: - id: black - repo: https://github.com/PyCQA/flake8 rev: 7.0.0 hooks: - id: flake8 - repo: https://github.com/sphinx-contrib/sphinx-lint rev: v0.9.1 hooks: - id: sphinx-lint args: [--jobs=1] files: ^docs/|CHANGELOG.rst|README.rst types: [rst] sphinx-sitemap-2.6.0/.vale.ini000066400000000000000000000003771461356132000162060ustar00rootroot00000000000000StylesPath = ./docs/_vale MinAlertLevel = suggestion # SphinxBuildPath = docs/_build # SphinxAutoBuild = make html Packages = write-good, Microsoft [*.rst] BasedOnStyles = Vale, custom Vale.Redundancy = YES Vale.Repetition = YES Vale.GenderBias = YES sphinx-sitemap-2.6.0/CHANGELOG.rst000066400000000000000000000133601461356132000165150ustar00rootroot00000000000000.. vale off Changelog ========= 2.6.0 ----- *Release date: TBD* * |:wrench:| MAINT: Fix deprecated sphinx.testing.path `#83 `_ * Drop test support for Python 3.7 and Sphinx 2, 3, and 4. * |:sparkles:| NEW: Add sitemap_excludes configuration `#91 `_ 2.5.1 ----- *Release date: 2023-08-17* * |:bug:| FIX: Fix Path use for Sphinx 7.2 `#70 `_ * |:bug:| FIX: Fix incremental building by preventing multiprocessing queue from being pickled with environment `#62 `_ * |:wrench:| MAINT: Add docstrings and type hints `#61 `_ 2.5.0 ----- *Release date: 2023-01-28* * |:books:| DOCS: Calculate version for sitemap based on current tag `#53 `_ * |:test_tube:| TESTS: Add Sphinx 6 env to tox `#55 `_ * |:sparkles:| NEW: Add support for Sphinx config "html_file_suffix" `#57 `_ * |:books:| DOCS: Add site search optimization `#58 `_ 2.4.0 ----- *Release date: 2022-12-26* * |:books:| DOCS: Add ReadTheDocs docs `#45 `_ * |:wrench:| MAINT: General code clean up `#46 `_ * |:sparkles:| NEW: Add support for parallel mode `#47 `_ * |:test_tube:| TESTS: Add tests for ``dirhtml`` builder `#48 `_ * |:test_tube:| TESTS: Add vale support for docs `#49 `_ * |:bug:| FIX: Fix wheel includes so they don't include docs and tests `#51 `_ * |:books:| DOCS: Add write-good and improve writing `#52 `_ 2.3.0 ----- *Release date: 2022-12-21* * |:wrench:| MAINT: Clean up how package versions are handled * |:test_tube:| TESTS: Install pre-commit with ``isort``, ``black``, and ``flake8`` `#35 `_ * |:books:| DOCS: Improve the wording of the README to help with issues upgrading to Sphinx 5 `#36 `_ * |:bug:| FIX: Follow correct format for multilingual sitemaps `#38 `_ * |:wrench:| MAINT: Update the build process `#39 `_ * |:test_tube:| TESTS: Add testing infrastructure `#41 `_ `#42 `_ * |:wrench:| MAINT: Use logging for all logging messages `#40 `_ 2.2.1 ----- *Release date: 2022-11-11* * |:books:| DOCS: Fix :confval:`sitemap_url_scheme` default value in **README** file `#32 `_ * |:wrench:| MAINT: Clean up package classifiers * |:wrench:| MAINT: Add **LICENSE** to source distributions `#27 `_ * |:books:| DOCS: Add Conda Forge badge to **README** file 2.2.0 ------ *Release date: 2020-08-05* * |:wrench:| MAINT: Add ``parallel_write_safe`` flag and set to `False` `#20 `_. * |:sparkles:| Add :confval:`sitemap_locales` that creates an allow list of locales `#25 `_. * |:sparkles:| Add :confval:`sitemap_filename` that allows for custom sitemap name `#26 `_. 2.1.0 ----- *Release date: 2020-02-22* * |:bug:| FIX: Make sure the regional variants for the ``hreflang`` attribute are valid `#19 `_. 2.0.0 ----- *Release date: 2020-02-19* * |:sparkles:| NEW: Add :confval:`sitemap_url_scheme` that allows the URL scheme to be customized with a default of ``{version}{lang}{link}`` `#22 `_. .. note:: This has the potential to be a breaking change depending on how the ``version`` and ``language`` values are set. **Confirm the accuracy of the sitemap after upgrading**. 1.1.0 ----- *Release date: 2019-12-12* * |:sparkles:| NEW: Add support for ``DirectoryHTMLBuilder``. * |:wrench:| MAINT: Remove unused ``HTMLTranslator`` import. * |:sparkles:| NEW: Make ``version`` and ``language`` each optional. * |:wrench:| MAINT: Add license to **setup.py**. * |:wrench:| MAINT: Mark unsafe for parallel reading. 1.0.2 ----- *Release date: 2019-02-09* * |:wrench:| MAINT: Add ``html_baseurl`` if it doesn't exist for sphinx versions prior to 1.8.0. 1.0.1 ----- *Release date: 2019-01-17* * |:bug:| FIX: Fix for ``AttributeError: No such config value: html_baseurl`` on versions of sphinx older than 1.8.0. 1.0.0 ----- *Release date: 2019-01-17* * |:wrench:| MAINT: Use native ``html_baseurl``, instead of the custom ``site_url``. It checks for both for backwards compatibility. * |:sparkles:| NEW: Add support for multiple languages. 0.3.1 ----- *Release date: 2018-03-04* * |:books:| DOCS: Add instructions on maintaining PyPI version to the docs 0.3.0 ----- *Release date: 2018-03-04* * |:wrench:| MAINT: Remove unnecessary ``HTMLTranslator``. * |:books:| DOCS: Improve documentation 0.2 --- *Release date: 2017-11-28* * |:wrench:| MAINT: Fix PyPI description 0.1 --- *Release date: 2017-11-28* * Initial Release |:tada:| sphinx-sitemap-2.6.0/LICENSE000066400000000000000000000020561461356132000155010ustar00rootroot00000000000000MIT License Copyright (c) 2017 Jared Dillard Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. sphinx-sitemap-2.6.0/MAINTENANCE.md000066400000000000000000000011171461356132000165350ustar00rootroot00000000000000# Maintaining PyPI Version These are the steps, to be run by the maintainer, for making a new Python package release. 1. Rev `__version__` in **sphinx_sitemap/\_\_init\_\_.py**. 2. Update **CHANGELOG.rst** 3. Create a tag and push to GitHub: git tag -a vX.Y.Z -m "Release vX.Y.Z" git push --tags origin master 4. Build the latest distribution locally: python -m build 5. Upload to the test pypi.org repository: twine upload --repository-url https://test.pypi.org/legacy/ dist/* 6. Upload to the production pypi.org repository: twine upload dist/* sphinx-sitemap-2.6.0/MANIFEST.in000066400000000000000000000000201461356132000162170ustar00rootroot00000000000000include LICENSE sphinx-sitemap-2.6.0/README.rst000066400000000000000000000042461461356132000161660ustar00rootroot00000000000000Sphinx Sitemap Generator Extension ================================== A `Sphinx`_ extension to generate multiversion and multilanguage `sitemaps.org`_ compliant sitemaps for the HTML version of your Sphinx documentation. | |PyPI version| |Conda Forge| |Downloads| |Parallel Safe| | |Code style: Black| |Docs Build| |CI Workflow| Documentation ------------- See `sphinx-sitemap documentation`_ for installation and configuration instructions. Contributing ------------ Pull Requests welcome! See `Contributing`_ for instructions on how best to contribute. License ------- **sphinx-sitemap** is made available under a **MIT license**; see `LICENSE`_ for details. Originally based on the sitemap generator in the `guzzle_sphinx_theme`_ project, also licensed under the MIT license. .. _Contributing: https://sphinx-sitemap.readthedocs.io/en/latest/contributing.html .. _guzzle_sphinx_theme: https://github.com/guzzle/guzzle_sphinx_theme .. _LICENSE: LICENSE .. _Sphinx: http://sphinx-doc.org/ .. _sitemaps.org: https://www.sitemaps.org/protocol.html .. _sphinx-sitemap documentation: https://sphinx-sitemap.readthedocs.io/en/latest/index.html .. |PyPI version| image:: https://img.shields.io/pypi/v/sphinx-sitemap.svg :target: https://pypi.python.org/pypi/sphinx-sitemap .. |Conda Forge| image:: https://img.shields.io/conda/vn/conda-forge/sphinx-sitemap.svg :target: https://anaconda.org/conda-forge/sphinx-sitemap .. |Downloads| image:: https://static.pepy.tech/badge/sphinx-sitemap/month :target: https://pepy.tech/project/sphinx-sitemap .. |Code style: Black| image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/psf/black .. |Parallel Safe| image:: https://img.shields.io/badge/parallel%20safe-true-brightgreen :target: # .. |Docs Build| image:: https://readthedocs.org/projects/sphinx-sitemap/badge/?version=latest :target: https://sphinx-sitemap.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status .. |CI Workflow| image:: https://github.com/jdillard/sphinx-sitemap/actions/workflows/continuous-integration.yml/badge.svg :target: https://github.com/jdillard/sphinx-sitemap/actions/workflows/continuous-integration.yml sphinx-sitemap-2.6.0/docs/000077500000000000000000000000001461356132000154215ustar00rootroot00000000000000sphinx-sitemap-2.6.0/docs/Makefile000066400000000000000000000011501461356132000170560ustar00rootroot00000000000000# Minimal makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build SPHINXPROJ = SphinxSitemap SOURCEDIR = source BUILDDIR = _build # Put it first so that "make" without argument is like "make help". help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) sphinx-sitemap-2.6.0/docs/_vale/000077500000000000000000000000001461356132000165075ustar00rootroot00000000000000sphinx-sitemap-2.6.0/docs/_vale/custom/000077500000000000000000000000001461356132000200215ustar00rootroot00000000000000sphinx-sitemap-2.6.0/docs/_vale/custom/Spelling.yml000066400000000000000000000001411461356132000223150ustar00rootroot00000000000000extends: spelling message: "Did you really mean '%s'?" level: error ignore: - ignore_words.txt sphinx-sitemap-2.6.0/docs/_vale/ignore_words.txt000066400000000000000000000000161461356132000217460ustar00rootroot00000000000000Conda Algolia sphinx-sitemap-2.6.0/docs/_vale/write-good/000077500000000000000000000000001461356132000205675ustar00rootroot00000000000000sphinx-sitemap-2.6.0/docs/_vale/write-good/Cliches.yml000066400000000000000000000375361461356132000227020ustar00rootroot00000000000000extends: existence message: "Try to avoid using clichés like '%s'." ignorecase: true level: warning tokens: - a chip off the old block - a clean slate - a dark and stormy night - a far cry - a fine kettle of fish - a loose cannon - a penny saved is a penny earned - a tough row to hoe - a word to the wise - ace in the hole - acid test - add insult to injury - against all odds - air your dirty laundry - all fun and games - all in a day's work - all talk, no action - all thumbs - all your eggs in one basket - all's fair in love and war - all's well that ends well - almighty dollar - American as apple pie - an axe to grind - another day, another dollar - armed to the teeth - as luck would have it - as old as time - as the crow flies - at loose ends - at my wits end - avoid like the plague - babe in the woods - back against the wall - back in the saddle - back to square one - back to the drawing board - bad to the bone - badge of honor - bald faced liar - ballpark figure - banging your head against a brick wall - baptism by fire - barking up the wrong tree - bat out of hell - be all and end all - beat a dead horse - beat around the bush - been there, done that - beggars can't be choosers - behind the eight ball - bend over backwards - benefit of the doubt - bent out of shape - best thing since sliced bread - bet your bottom dollar - better half - better late than never - better mousetrap - better safe than sorry - between a rock and a hard place - beyond the pale - bide your time - big as life - big cheese - big fish in a small pond - big man on campus - bigger they are the harder they fall - bird in the hand - bird's eye view - birds and the bees - birds of a feather flock together - bit the hand that feeds you - bite the bullet - bite the dust - bitten off more than he can chew - black as coal - black as pitch - black as the ace of spades - blast from the past - bleeding heart - blessing in disguise - blind ambition - blind as a bat - blind leading the blind - blood is thicker than water - blood sweat and tears - blow off steam - blow your own horn - blushing bride - boils down to - bolt from the blue - bone to pick - bored stiff - bored to tears - bottomless pit - boys will be boys - bright and early - brings home the bacon - broad across the beam - broken record - brought back to reality - bull by the horns - bull in a china shop - burn the midnight oil - burning question - burning the candle at both ends - burst your bubble - bury the hatchet - busy as a bee - by hook or by crook - call a spade a spade - called onto the carpet - calm before the storm - can of worms - can't cut the mustard - can't hold a candle to - case of mistaken identity - cat got your tongue - cat's meow - caught in the crossfire - caught red-handed - checkered past - chomping at the bit - cleanliness is next to godliness - clear as a bell - clear as mud - close to the vest - cock and bull story - cold shoulder - come hell or high water - cool as a cucumber - cool, calm, and collected - cost a king's ransom - count your blessings - crack of dawn - crash course - creature comforts - cross that bridge when you come to it - crushing blow - cry like a baby - cry me a river - cry over spilt milk - crystal clear - curiosity killed the cat - cut and dried - cut through the red tape - cut to the chase - cute as a bugs ear - cute as a button - cute as a puppy - cuts to the quick - dark before the dawn - day in, day out - dead as a doornail - devil is in the details - dime a dozen - divide and conquer - dog and pony show - dog days - dog eat dog - dog tired - don't burn your bridges - don't count your chickens - don't look a gift horse in the mouth - don't rock the boat - don't step on anyone's toes - don't take any wooden nickels - down and out - down at the heels - down in the dumps - down the hatch - down to earth - draw the line - dressed to kill - dressed to the nines - drives me up the wall - dull as dishwater - dyed in the wool - eagle eye - ear to the ground - early bird catches the worm - easier said than done - easy as pie - eat your heart out - eat your words - eleventh hour - even the playing field - every dog has its day - every fiber of my being - everything but the kitchen sink - eye for an eye - face the music - facts of life - fair weather friend - fall by the wayside - fan the flames - feast or famine - feather your nest - feathered friends - few and far between - fifteen minutes of fame - filthy vermin - fine kettle of fish - fish out of water - fishing for a compliment - fit as a fiddle - fit the bill - fit to be tied - flash in the pan - flat as a pancake - flip your lid - flog a dead horse - fly by night - fly the coop - follow your heart - for all intents and purposes - for the birds - for what it's worth - force of nature - force to be reckoned with - forgive and forget - fox in the henhouse - free and easy - free as a bird - fresh as a daisy - full steam ahead - fun in the sun - garbage in, garbage out - gentle as a lamb - get a kick out of - get a leg up - get down and dirty - get the lead out - get to the bottom of - get your feet wet - gets my goat - gilding the lily - give and take - go against the grain - go at it tooth and nail - go for broke - go him one better - go the extra mile - go with the flow - goes without saying - good as gold - good deed for the day - good things come to those who wait - good time was had by all - good times were had by all - greased lightning - greek to me - green thumb - green-eyed monster - grist for the mill - growing like a weed - hair of the dog - hand to mouth - happy as a clam - happy as a lark - hasn't a clue - have a nice day - have high hopes - have the last laugh - haven't got a row to hoe - head honcho - head over heels - hear a pin drop - heard it through the grapevine - heart's content - heavy as lead - hem and haw - high and dry - high and mighty - high as a kite - hit paydirt - hold your head up high - hold your horses - hold your own - hold your tongue - honest as the day is long - horns of a dilemma - horse of a different color - hot under the collar - hour of need - I beg to differ - icing on the cake - if the shoe fits - if the shoe were on the other foot - in a jam - in a jiffy - in a nutshell - in a pig's eye - in a pinch - in a word - in hot water - in the gutter - in the nick of time - in the thick of it - in your dreams - it ain't over till the fat lady sings - it goes without saying - it takes all kinds - it takes one to know one - it's a small world - it's only a matter of time - ivory tower - Jack of all trades - jockey for position - jog your memory - joined at the hip - judge a book by its cover - jump down your throat - jump in with both feet - jump on the bandwagon - jump the gun - jump to conclusions - just a hop, skip, and a jump - just the ticket - justice is blind - keep a stiff upper lip - keep an eye on - keep it simple, stupid - keep the home fires burning - keep up with the Joneses - keep your chin up - keep your fingers crossed - kick the bucket - kick up your heels - kick your feet up - kid in a candy store - kill two birds with one stone - kiss of death - knock it out of the park - knock on wood - knock your socks off - know him from Adam - know the ropes - know the score - knuckle down - knuckle sandwich - knuckle under - labor of love - ladder of success - land on your feet - lap of luxury - last but not least - last hurrah - last-ditch effort - law of the jungle - law of the land - lay down the law - leaps and bounds - let sleeping dogs lie - let the cat out of the bag - let the good times roll - let your hair down - let's talk turkey - letter perfect - lick your wounds - lies like a rug - life's a bitch - life's a grind - light at the end of the tunnel - lighter than a feather - lighter than air - like clockwork - like father like son - like taking candy from a baby - like there's no tomorrow - lion's share - live and learn - live and let live - long and short of it - long lost love - look before you leap - look down your nose - look what the cat dragged in - looking a gift horse in the mouth - looks like death warmed over - loose cannon - lose your head - lose your temper - loud as a horn - lounge lizard - loved and lost - low man on the totem pole - luck of the draw - luck of the Irish - make hay while the sun shines - make money hand over fist - make my day - make the best of a bad situation - make the best of it - make your blood boil - man of few words - man's best friend - mark my words - meaningful dialogue - missed the boat on that one - moment in the sun - moment of glory - moment of truth - money to burn - more power to you - more than one way to skin a cat - movers and shakers - moving experience - naked as a jaybird - naked truth - neat as a pin - needle in a haystack - needless to say - neither here nor there - never look back - never say never - nip and tuck - nip it in the bud - no guts, no glory - no love lost - no pain, no gain - no skin off my back - no stone unturned - no time like the present - no use crying over spilled milk - nose to the grindstone - not a hope in hell - not a minute's peace - not in my backyard - not playing with a full deck - not the end of the world - not written in stone - nothing to sneeze at - nothing ventured nothing gained - now we're cooking - off the top of my head - off the wagon - off the wall - old hat - older and wiser - older than dirt - older than Methuselah - on a roll - on cloud nine - on pins and needles - on the bandwagon - on the money - on the nose - on the rocks - on the spot - on the tip of my tongue - on the wagon - on thin ice - once bitten, twice shy - one bad apple doesn't spoil the bushel - one born every minute - one brick short - one foot in the grave - one in a million - one red cent - only game in town - open a can of worms - open and shut case - open the flood gates - opportunity doesn't knock twice - out of pocket - out of sight, out of mind - out of the frying pan into the fire - out of the woods - out on a limb - over a barrel - over the hump - pain and suffering - pain in the - panic button - par for the course - part and parcel - party pooper - pass the buck - patience is a virtue - pay through the nose - penny pincher - perfect storm - pig in a poke - pile it on - pillar of the community - pin your hopes on - pitter patter of little feet - plain as day - plain as the nose on your face - play by the rules - play your cards right - playing the field - playing with fire - pleased as punch - plenty of fish in the sea - point with pride - poor as a church mouse - pot calling the kettle black - pretty as a picture - pull a fast one - pull your punches - pulling your leg - pure as the driven snow - put it in a nutshell - put one over on you - put the cart before the horse - put the pedal to the metal - put your best foot forward - put your foot down - quick as a bunny - quick as a lick - quick as a wink - quick as lightning - quiet as a dormouse - rags to riches - raining buckets - raining cats and dogs - rank and file - rat race - reap what you sow - red as a beet - red herring - reinvent the wheel - rich and famous - rings a bell - ripe old age - ripped me off - rise and shine - road to hell is paved with good intentions - rob Peter to pay Paul - roll over in the grave - rub the wrong way - ruled the roost - running in circles - sad but true - sadder but wiser - salt of the earth - scared stiff - scared to death - sealed with a kiss - second to none - see eye to eye - seen the light - seize the day - set the record straight - set the world on fire - set your teeth on edge - sharp as a tack - shoot for the moon - shoot the breeze - shot in the dark - shoulder to the wheel - sick as a dog - sigh of relief - signed, sealed, and delivered - sink or swim - six of one, half a dozen of another - skating on thin ice - slept like a log - slinging mud - slippery as an eel - slow as molasses - smart as a whip - smooth as a baby's bottom - sneaking suspicion - snug as a bug in a rug - sow wild oats - spare the rod, spoil the child - speak of the devil - spilled the beans - spinning your wheels - spitting image of - spoke with relish - spread like wildfire - spring to life - squeaky wheel gets the grease - stands out like a sore thumb - start from scratch - stick in the mud - still waters run deep - stitch in time - stop and smell the roses - straight as an arrow - straw that broke the camel's back - strong as an ox - stubborn as a mule - stuff that dreams are made of - stuffed shirt - sweating blood - sweating bullets - take a load off - take one for the team - take the bait - take the bull by the horns - take the plunge - takes one to know one - takes two to tango - the more the merrier - the real deal - the real McCoy - the red carpet treatment - the same old story - there is no accounting for taste - thick as a brick - thick as thieves - thin as a rail - think outside of the box - third time's the charm - this day and age - this hurts me worse than it hurts you - this point in time - three sheets to the wind - through thick and thin - throw in the towel - tie one on - tighter than a drum - time and time again - time is of the essence - tip of the iceberg - tired but happy - to coin a phrase - to each his own - to make a long story short - to the best of my knowledge - toe the line - tongue in cheek - too good to be true - too hot to handle - too numerous to mention - touch with a ten foot pole - tough as nails - trial and error - trials and tribulations - tried and true - trip down memory lane - twist of fate - two cents worth - two peas in a pod - ugly as sin - under the counter - under the gun - under the same roof - under the weather - until the cows come home - unvarnished truth - up the creek - uphill battle - upper crust - upset the applecart - vain attempt - vain effort - vanquish the enemy - vested interest - waiting for the other shoe to drop - wakeup call - warm welcome - watch your p's and q's - watch your tongue - watching the clock - water under the bridge - weather the storm - weed them out - week of Sundays - went belly up - wet behind the ears - what goes around comes around - what you see is what you get - when it rains, it pours - when push comes to shove - when the cat's away - when the going gets tough, the tough get going - white as a sheet - whole ball of wax - whole hog - whole nine yards - wild goose chase - will wonders never cease? - wisdom of the ages - wise as an owl - wolf at the door - words fail me - work like a dog - world weary - worst nightmare - worth its weight in gold - wrong side of the bed - yanking your chain - yappy as a dog - years young - you are what you eat - you can run but you can't hide - you only live once - you're the boss - young and foolish - young and vibrant sphinx-sitemap-2.6.0/docs/_vale/write-good/E-Prime.yml000066400000000000000000000005541461356132000225540ustar00rootroot00000000000000extends: existence message: "Try to avoid using '%s'." ignorecase: true level: suggestion tokens: - am - are - aren't - be - been - being - he's - here's - here's - how's - i'm - is - isn't - it's - she's - that's - there's - they're - was - wasn't - we're - were - weren't - what's - where's - who's - you're sphinx-sitemap-2.6.0/docs/_vale/write-good/Illusions.yml000066400000000000000000000002311461356132000232670ustar00rootroot00000000000000extends: repetition message: "'%s' is repeated!" level: warning alpha: true action: name: edit params: - truncate - " " tokens: - '[^\s]+' sphinx-sitemap-2.6.0/docs/_vale/write-good/Passive.yml000066400000000000000000000036521461356132000227320ustar00rootroot00000000000000extends: existence message: "'%s' may be passive voice. Use active voice if you can." ignorecase: true level: warning raw: - \b(am|are|were|being|is|been|was|be)\b\s* tokens: - '[\w]+ed' - awoken - beat - become - been - begun - bent - beset - bet - bid - bidden - bitten - bled - blown - born - bought - bound - bred - broadcast - broken - brought - built - burnt - burst - cast - caught - chosen - clung - come - cost - crept - cut - dealt - dived - done - drawn - dreamt - driven - drunk - dug - eaten - fallen - fed - felt - fit - fled - flown - flung - forbidden - foregone - forgiven - forgotten - forsaken - fought - found - frozen - given - gone - gotten - ground - grown - heard - held - hidden - hit - hung - hurt - kept - knelt - knit - known - laid - lain - leapt - learnt - led - left - lent - let - lighted - lost - made - meant - met - misspelt - mistaken - mown - overcome - overdone - overtaken - overthrown - paid - pled - proven - put - quit - read - rid - ridden - risen - run - rung - said - sat - sawn - seen - sent - set - sewn - shaken - shaven - shed - shod - shone - shorn - shot - shown - shrunk - shut - slain - slept - slid - slit - slung - smitten - sold - sought - sown - sped - spent - spilt - spit - split - spoken - spread - sprung - spun - stolen - stood - stridden - striven - struck - strung - stuck - stung - stunk - sung - sunk - swept - swollen - sworn - swum - swung - taken - taught - thought - thrived - thrown - thrust - told - torn - trodden - understood - upheld - upset - wed - wept - withheld - withstood - woken - won - worn - wound - woven - written - wrung sphinx-sitemap-2.6.0/docs/_vale/write-good/README.md000066400000000000000000000023551461356132000220530ustar00rootroot00000000000000Based on [write-good](https://github.com/btford/write-good). > Naive linter for English prose for developers who can't write good and wanna learn to do other stuff good too. ``` The MIT License (MIT) Copyright (c) 2014 Brian Ford Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ``` sphinx-sitemap-2.6.0/docs/_vale/write-good/So.yml000066400000000000000000000001641461356132000216740ustar00rootroot00000000000000extends: existence message: "Don't start a sentence with '%s'." level: error raw: - '(?:[;-]\s)so[\s,]|\bSo[\s,]' sphinx-sitemap-2.6.0/docs/_vale/write-good/ThereIs.yml000066400000000000000000000002301461356132000226500ustar00rootroot00000000000000extends: existence message: "Don't start a sentence with '%s'." ignorecase: false level: error raw: - '(?:[;-]\s)There\s(is|are)|\bThere\s(is|are)\b' sphinx-sitemap-2.6.0/docs/_vale/write-good/TooWordy.yml000066400000000000000000000071001461356132000230760ustar00rootroot00000000000000extends: existence message: "'%s' is too wordy." ignorecase: true level: warning tokens: - a number of - abundance - accede to - accelerate - accentuate - accompany - accomplish - accorded - accrue - acquiesce - acquire - additional - adjacent to - adjustment - admissible - advantageous - adversely impact - advise - aforementioned - aggregate - aircraft - all of - all things considered - alleviate - allocate - along the lines of - already existing - alternatively - amazing - ameliorate - anticipate - apparent - appreciable - as a matter of fact - as a means of - as far as I'm concerned - as of yet - as to - as yet - ascertain - assistance - at the present time - at this time - attain - attributable to - authorize - because of the fact that - belated - benefit from - bestow - by means of - by virtue of - by virtue of the fact that - cease - close proximity - commence - comply with - concerning - consequently - consolidate - constitutes - demonstrate - depart - designate - discontinue - due to the fact that - each and every - economical - eliminate - elucidate - employ - endeavor - enumerate - equitable - equivalent - evaluate - evidenced - exclusively - expedite - expend - expiration - facilitate - factual evidence - feasible - finalize - first and foremost - for all intents and purposes - for the most part - for the purpose of - forfeit - formulate - have a tendency to - honest truth - however - if and when - impacted - implement - in a manner of speaking - in a timely manner - in a very real sense - in accordance with - in addition - in all likelihood - in an effort to - in between - in excess of - in lieu of - in light of the fact that - in many cases - in my opinion - in order to - in regard to - in some instances - in terms of - in the case of - in the event that - in the final analysis - in the nature of - in the near future - in the process of - inception - incumbent upon - indicate - indication - initiate - irregardless - is applicable to - is authorized to - is responsible for - it is - it is essential - it seems that - it was - magnitude - maximum - methodology - minimize - minimum - modify - monitor - multiple - necessitate - nevertheless - not certain - not many - not often - not unless - not unlike - notwithstanding - null and void - numerous - objective - obligate - obtain - on the contrary - on the other hand - one particular - optimum - overall - owing to the fact that - participate - particulars - pass away - pertaining to - point in time - portion - possess - preclude - previously - prior to - prioritize - procure - proficiency - provided that - purchase - put simply - readily apparent - refer back - regarding - relocate - remainder - remuneration - requirement - reside - residence - retain - satisfy - shall - should you wish - similar to - solicit - span across - strategize - subsequent - substantial - successfully complete - sufficient - terminate - the month of - the point I am trying to make - therefore - time period - took advantage of - transmit - transpire - type of - until such time as - utilization - utilize - validate - various different - what I mean to say is - whether or not - with respect to - with the exception of - witnessed sphinx-sitemap-2.6.0/docs/_vale/write-good/Weasel.yml000066400000000000000000000053071461356132000225370ustar00rootroot00000000000000extends: existence message: "'%s' is a weasel word!" ignorecase: true level: warning tokens: - absolutely - accidentally - additionally - allegedly - alternatively - angrily - anxiously - approximately - awkwardly - badly - barely - beautifully - blindly - boldly - bravely - brightly - briskly - bristly - bubbly - busily - calmly - carefully - carelessly - cautiously - cheerfully - clearly - closely - coldly - completely - consequently - correctly - courageously - crinkly - cruelly - crumbly - cuddly - currently - daily - daringly - deadly - definitely - deliberately - doubtfully - dumbly - eagerly - early - easily - elegantly - enormously - enthusiastically - equally - especially - eventually - exactly - exceedingly - exclusively - extremely - fairly - faithfully - fatally - fiercely - finally - fondly - few - foolishly - fortunately - frankly - frantically - generously - gently - giggly - gladly - gracefully - greedily - happily - hardly - hastily - healthily - heartily - helpfully - honestly - hourly - hungrily - hurriedly - immediately - impatiently - inadequately - ingeniously - innocently - inquisitively - interestingly - irritably - jiggly - joyously - justly - kindly - largely - lately - lazily - likely - literally - lonely - loosely - loudly - loudly - luckily - madly - many - mentally - mildly - monthly - mortally - mostly - mysteriously - neatly - nervously - nightly - noisily - normally - obediently - occasionally - only - openly - painfully - particularly - patiently - perfectly - politely - poorly - powerfully - presumably - previously - promptly - punctually - quarterly - quickly - quietly - rapidly - rarely - really - recently - recklessly - regularly - remarkably - relatively - reluctantly - repeatedly - rightfully - roughly - rudely - sadly - safely - selfishly - sensibly - seriously - sharply - shortly - shyly - significantly - silently - simply - sleepily - slowly - smartly - smelly - smoothly - softly - solemnly - sparkly - speedily - stealthily - sternly - stupidly - substantially - successfully - suddenly - surprisingly - suspiciously - swiftly - tenderly - tensely - thoughtfully - tightly - timely - truthfully - unexpectedly - unfortunately - usually - very - victoriously - violently - vivaciously - warmly - waverly - weakly - wearily - weekly - wildly - wisely - worldly - wrinkly - yearly sphinx-sitemap-2.6.0/docs/_vale/write-good/meta.json000066400000000000000000000001431461356132000224060ustar00rootroot00000000000000{ "feed": "https://github.com/errata-ai/write-good/releases.atom", "vale_version": ">=1.0.0" } sphinx-sitemap-2.6.0/docs/requirements.txt000066400000000000000000000001271461356132000207050ustar00rootroot00000000000000furo esbonio sphinx-contributors sphinx sphinx-sitemap sphinxemoji sphinxext-opengraph sphinx-sitemap-2.6.0/docs/source/000077500000000000000000000000001461356132000167215ustar00rootroot00000000000000sphinx-sitemap-2.6.0/docs/source/_static/000077500000000000000000000000001461356132000203475ustar00rootroot00000000000000sphinx-sitemap-2.6.0/docs/source/_static/sitemap-icon.svg000066400000000000000000000024041461356132000234600ustar00rootroot00000000000000 sphinx-sitemap-2.6.0/docs/source/advanced-configuration.rst000066400000000000000000000121271461356132000240700ustar00rootroot00000000000000Advanced Configuration ====================== .. _configuration_customizing_url_scheme: Customizing the URL Scheme ^^^^^^^^^^^^^^^^^^^^^^^^^^ :confval:`sitemap_url_scheme` defaults to ``{lang}{version}{link}``, where ``{lang}`` and ``{version}`` get set by :confval:`language` and :confval:`version` in **conf.py**. .. important:: As of Sphinx version 5, ``language`` defaults to ``"en"``, if that makes the default scheme produce the incorrect URL, then change the default behavior. To change the default behavior, set the value of :confval:`sitemap_url_scheme` in **conf.py** to the desired format. For example: .. code-block:: python sitemap_url_scheme = "{link}" Or for nested deployments, something like: .. code-block:: python sitemap_url_scheme = "{version}{lang}subdir/{link}" .. note:: The extension automatically appends trailing slashes to both the ``language`` and ``version`` values. You can also omit values from the scheme for desired behavior. .. _configuration_changing_filename: Changing the Filename ^^^^^^^^^^^^^^^^^^^^^ Set :confval:`sitemap_filename` in **conf.py** to the desired filename, for example: .. code-block:: python sitemap_filename = "sitemap.xml" Version Support ^^^^^^^^^^^^^^^ :confval:`version` specifies the version of the sitemap. For multi-version sitemaps, generate a sitemap per version and then manually add each to a `sitemapindex.xml`_ file. Tagged Releases ~~~~~~~~~~~~~~~ For a tagged release deploy strategy where the ``latest`` gets created from head of the branch and versions get created from tagged commits, check to see if the current commit matches the release tag regex and set :confval:`version` accordingly. .. code-block:: python # check if the current commit is tagged as a release (vX.Y.Z) and set the version GIT_TAG_OUTPUT = subprocess.check_output(["git", "tag", "--points-at", "HEAD"]) current_tag = GIT_TAG_OUTPUT.decode().strip() if re.match(r"^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$", current_tag): version = current_tag else: version = "latest" .. tip:: Set the canonical URL in the theme layout of all versions to the latest version of that page, for example: .. code-block:: html .. _configuration_supporting_multiple_languages: Language Support ^^^^^^^^^^^^^^^^ :confval:`language` specifies the primary language. Any alternative languages get detected using the contents of :confval:`locale_dirs`. For example, with a primary language of **en**, and **es** and **fr** as detected translations, the sitemap look like this: .. code-block:: xml https://my-site.com/docs/en/index.html https://my-site.com/docs/en/about.html Use :confval:`sitemap_locales` to manually specify a list of locales to include in the sitemap: .. code-block:: python sitemap_locales = ['en', 'es'] The end result looks something like the following for each language/version build: .. code-block:: xml https://my-site.com/docs/en/index.html https://my-site.com/docs/en/about.html To generate the primary language with no alternatives, set :confval:`sitemap_locales` to ``[None]``: .. code-block:: python sitemap_locales = [None] For multilingual sitemaps, generate a sitemap per language and then manually add each to a `sitemapindex.xml`_ file. .. _configuration_excluding_pages: Excluding Pages ^^^^^^^^^^^^^^^ To exclude a set of pages, add each page's path to ``sitemap_exclude``: .. code-block:: python sitemap_excludes = [ "search.html", "genindex.html", ] .. _sitemapindex.xml: https://support.google.com/webmasters/answer/75712?hl=en .. _sitemaps.org: https://www.sitemaps.org/protocol.html sphinx-sitemap-2.6.0/docs/source/changelog.rst000066400000000000000000000000411461356132000213750ustar00rootroot00000000000000.. include:: ../../CHANGELOG.rst sphinx-sitemap-2.6.0/docs/source/conf.py000066400000000000000000000131551461356132000202250ustar00rootroot00000000000000# # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import re import subprocess # -- Project information ----------------------------------------------------- project = "Sphinx Sitemap" copyright = "Jared Dillard" author = "Jared Dillard" # check if the current commit is tagged as a release (vX.Y.Z) GIT_TAG_OUTPUT = subprocess.check_output(["git", "tag", "--points-at", "HEAD"]) current_tag = GIT_TAG_OUTPUT.decode().strip() if re.match(r"^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$", current_tag): version = current_tag else: version = "latest" # The full version, including alpha/beta/rc tags release = "" # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ "sphinx_sitemap", "sphinxemoji.sphinxemoji", "sphinx_contributors", "sphinx.ext.intersphinx", "sphinxext.opengraph", ] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = ".rst" # The master toctree document. master_doc = "index" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" intersphinx_mapping = { "sphinx": ("https://www.sphinx-doc.org/en/master/", None), } # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = "furo" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. # html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] html_logo = "_static/sitemap-icon.svg" html_title = "Sphinx Sitemap" ogp_site_url = "https://sphinx-sitemap.readthedocs.io/" ogp_image = "https://sphinx-sitemap.readthedocs.io/en/latest/_static/sitemap-icon.svg" # Custom sidebar templates, must be a dictionary that maps document names # to template names. # # The default sidebars (for documents that don't match any pattern) are # defined by theme itself. Builtin themes are using these templates by # default: ``['localtoc.html', 'relations.html', 'sourcelink.html', # 'searchbox.html']``. # # html_sidebars = {} html_baseurl = "https://sphinx-sitemap.readthedocs.org/" # -- Options for HTMLHelp output --------------------------------------------- # Output file base name for HTML help builder. htmlhelp_basename = "SphinxSitemapdoc" # -- Options for LaTeX output ------------------------------------------------ latex_elements = { # The paper size ('letterpaper' or 'a4paper'). # # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # # 'preamble': '', # Latex figure (float) alignment # # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ( master_doc, "SphinxSitemap.tex", "Sphinx Sitemap Documentation", "Jared Dillard", "manual", ) ] # -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [(master_doc, "sphinxsitemap", "Sphinx Sitemap Documentation", [author], 1)] # -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ( master_doc, "SphinxSitemap", "Sphinx Sitemap Documentation", author, "SphinxSitemap", "One line description of project.", "Miscellaneous", ) ] def setup(app): app.add_object_type( "confval", "confval", objname="configuration value", indextemplate="pair: %s; configuration value", ) sphinx-sitemap-2.6.0/docs/source/configuration-values.rst000066400000000000000000000016151461356132000236220ustar00rootroot00000000000000Project Configuration Values ============================ A list of of possible configuration values to configure in **conf.py**: .. confval:: sitemap_url_scheme The scheme used for URL structure. Default is ``{lang}{version}{link}``. See :ref:`configuration_customizing_url_scheme` for more information. .. versionadded:: 2.0.0 .. confval:: sitemap_filename The filename used for the the sitemap. Default is ``sitemap.xml``. See :ref:`configuration_changing_filename` for more information. .. versionadded:: 2.2.0 .. confval:: sitemap_locales The list of locales to include in the sitemap. See :ref:`configuration_supporting_multiple_languages` for more information. .. versionadded:: 2.2.0 .. confval:: sitemap_excludes The list of pages to exclude from the sitemap. See :ref:`configuration_excluding_pages` for more information. .. versionadded:: 2.6.0 sphinx-sitemap-2.6.0/docs/source/contributing.rst000066400000000000000000000033511461356132000221640ustar00rootroot00000000000000Contributing ============ You will need to set up a development environment to make and test your changes before submitting them. Local development ----------------- #. Clone the `sphinx-sitemap repository`_. #. Create and activate a virtual environment: .. code-block:: console python3 -m venv .venv source .venv/bin/activate #. Install development dependencies: .. code-block:: console pip3 install -r dev-requirements.txt #. Install pre-commit Git hook scripts: .. code-block:: console pre-commit install Install a local copy of the extension ------------------------------------- Add **sphinx-sitemap** as a `third party extension`_. #. If your project doesn't have an extensions directory, create ``_exts`` and point **conf.py** to it: .. code-block:: python sys.path.append(os.path.abspath('../_exts')) #. Copy ``sphinx_sitemap`` as a directory in your project's extensions directory, and rename it to ``sphinx_sitemap_dev``. #. Add ``sphinx_sitemap_dev`` to :confval:`extensions`, or if already installed via ``pip``, change ``sphinx_sitemap`` to ``sphinx_sitemap_dev`` in **conf.py**: .. code-block:: python extensions = ['sphinx_sitemap_dev'] You can now make changes to ``sphinx_sitemap_dev``. Testing changes --------------- Run ``tox`` before committing changes. Current contributors -------------------- Thanks to all who have contributed! The people that have improved the code: .. contributors:: jdillard/sphinx-sitemap :avatars: :limit: 100 :exclude: pre-commit-ci[bot],dependabot[bot] :order: ASC .. _sphinx-sitemap repository: https://github.com/jdillard/sphinx-sitemap .. _third party extension: http://www.sphinx-doc.org/en/master/ext/thirdparty.html sphinx-sitemap-2.6.0/docs/source/getting-started.rst000066400000000000000000000017041461356132000225620ustar00rootroot00000000000000Getting Started =============== Installation ------------ Directly install via ``pip`` by using: .. code:: pip install sphinx-sitemap Or with ``conda`` via ``conda-forge``: .. code:: conda install -c conda-forge sphinx-sitemap Usage ----- Add ``sphinx_sitemap`` to :confval:`extensions` in your Sphinx **conf.py**. For example: .. code:: python extensions = ['sphinx_sitemap'] Set the value of :confval:`html_baseurl` in your Sphinx **conf.py** to the current base URL of your documentation. For example: .. code:: python html_baseurl = 'https://my-site.com/docs/' After the HTML finishes building, **sphinx-sitemap** will output the location of the sitemap:: sitemap.xml was generated for URL https://my-site.com/docs/ in /path/to/_build/sitemap.xml .. tip:: Make sure to confirm the accuracy of the sitemap after installs and upgrades. See :doc:`advanced-configuration` for more information about how to use **sphinx-sitemap**. sphinx-sitemap-2.6.0/docs/source/index.rst000066400000000000000000000024701461356132000205650ustar00rootroot00000000000000sphinx-sitemap ============== A `Sphinx`_ extension to generate multi-version and multi-language `sitemaps.org`_ compliant sitemaps for the HTML version of your Sphinx documentation. |PyPI version| |Conda Forge| |Downloads| |Parallel Safe| |GitHub Stars| .. toctree:: :maxdepth: 2 getting-started advanced-configuration search-optimization configuration-values contributing changelog .. _sitemaps.org: https://www.sitemaps.org/protocol.html .. _Sphinx: http://sphinx-doc.org/ .. |PyPI version| image:: https://img.shields.io/pypi/v/sphinx-sitemap.svg :target: https://pypi.python.org/pypi/sphinx-sitemap :alt: Latest PyPi Version .. |Conda Forge| image:: https://img.shields.io/conda/vn/conda-forge/sphinx-sitemap.svg :target: https://anaconda.org/conda-forge/sphinx-sitemap :alt: Latest Conda Forge version .. |Downloads| image:: https://static.pepy.tech/badge/sphinx-sitemap/month :target: https://pepy.tech/project/sphinx-sitemap :alt: PyPi Downloads per month .. |Parallel Safe| image:: https://img.shields.io/badge/parallel%20safe-true-brightgreen :target: # :alt: Parallel read/write safe .. |GitHub Stars| image:: https://img.shields.io/github/stars/jdillard/sphinx-sitemap?style=social :target: https://github.com/jdillard/sphinx-sitemap :alt: GitHub Repository stars sphinx-sitemap-2.6.0/docs/source/search-optimization.rst000066400000000000000000000016161461356132000234500ustar00rootroot00000000000000Getting the Most out of the Sitemap =================================== Search Engine Optimization -------------------------- Using robots.txt ^^^^^^^^^^^^^^^^ Add a **robots.txt** file in the **source** directory which has a link to the ``sitemap.xml`` or ``sitemapindex.xml`` file. For example:: User-agent: * Sitemap: https://my-site.com/docs/sitemap.xml Then, add **robots.txt** to :confval:`html_extra_path` in **conf.py**: .. code-block:: python html_extra_path = ['robots.txt'] Submit Sitemap to Search Engines ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Submit the ``sitemap.xml`` or ``sitemapindex.xml`` to the appropriate search engine tools. Site Search Optimization ------------------------ Site search crawlers can also take advantage of sitemaps as starting points for crawling. Examples: - `Algolia`_ .. _Algolia: https://www.algolia.com/doc/tools/crawler/apis/configuration/sitemaps/ sphinx-sitemap-2.6.0/pyproject.toml000066400000000000000000000022511461356132000174050ustar00rootroot00000000000000 [build-system] requires = [ "setuptools", ] build-backend = "setuptools.build_meta" [project] name = "sphinx-sitemap" description = "Sitemap generator for Sphinx" authors = [ {name = "Jared Dillard", email = "jared.dillard@gmail.com"}, ] maintainers = [ {name = "Jared Dillard", email = "jared.dillard@gmail.com"}, ] classifiers = [ "License :: OSI Approved :: MIT License", "Topic :: Documentation :: Sphinx", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Framework :: Sphinx :: Extension", ] license = {text = "MIT"} readme = "README.rst" dynamic = [ "version", "dependencies", "optional-dependencies", ] [project.urls] documentation = "https://sphinx-sitemap.readthedocs.io/en/latest/index.html" download = "https://pypi.org/project/sphinx-sitemap/" source = "https://github.com/jdillard/sphinx-sitemap" changelog = "https://github.com/jdillard/sphinx-sitemap/blob/master/CHANGELOG.rst" [tool.setuptools.dynamic] optional-dependencies = {dev = { file = ["requirements_dev.txt"] }} [tool.isort] profile = "black" sphinx-sitemap-2.6.0/readthedocs.yml000066400000000000000000000003201461356132000174740ustar00rootroot00000000000000version: 2 build: os: "ubuntu-20.04" tools: python: "3.10" sphinx: configuration: docs/source/conf.py python: install: - requirements: docs/requirements.txt - method: pip path: . sphinx-sitemap-2.6.0/requirements_dev.txt000066400000000000000000000000521461356132000206100ustar00rootroot00000000000000tox build pre-commit flake8 sphinx pytest sphinx-sitemap-2.6.0/setup.cfg000066400000000000000000000002741461356132000163150ustar00rootroot00000000000000[metadata] version = attr: sphinx_sitemap.__version__ [options] packages = find_namespace: install_requires = sphinx>=1.2 [options.packages.find] where = . include = sphinx_sitemap* sphinx-sitemap-2.6.0/setup.py000066400000000000000000000001051461356132000161770ustar00rootroot00000000000000import setuptools if __name__ == "__main__": setuptools.setup() sphinx-sitemap-2.6.0/sphinx_sitemap/000077500000000000000000000000001461356132000175245ustar00rootroot00000000000000sphinx-sitemap-2.6.0/sphinx_sitemap/__init__.py000066400000000000000000000163311461356132000216410ustar00rootroot00000000000000# Copyright (c) 2013 Michael Dowling # Copyright (c) 2017 Jared Dillard # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. import os import queue from multiprocessing import Manager from pathlib import Path from typing import Any, Dict, List, Optional from xml.etree import ElementTree from sphinx.application import Sphinx from sphinx.util.logging import getLogger __version__ = "2.6.0" logger = getLogger(__name__) def setup(app: Sphinx) -> Dict[str, Any]: """ Sphinx extension setup function. It adds config values and connects Sphinx events to the sitemap builder. :param app: The Sphinx Application instance :return: A dict of Sphinx extension options """ app.add_config_value("site_url", default=None, rebuild="") app.add_config_value( "sitemap_url_scheme", default="{lang}{version}{link}", rebuild="" ) app.add_config_value("sitemap_locales", default=None, rebuild="") app.add_config_value("sitemap_filename", default="sitemap.xml", rebuild="") app.add_config_value("sitemap_excludes", default=[], rebuild="") try: app.add_config_value("html_baseurl", default=None, rebuild="") except BaseException: pass app.connect("builder-inited", record_builder_type) app.connect("html-page-context", add_html_link) app.connect("build-finished", create_sitemap) return { "parallel_read_safe": True, "parallel_write_safe": True, "version": __version__, } def get_locales(app: Sphinx) -> List[str]: """ Get a list of locales from the extension config or automatically detect based on Sphinx Application config. :param app: The Sphinx Application instance :return: A list of locales """ # Manually configured list of locales sitemap_locales: Optional[List[str]] = app.builder.config.sitemap_locales if sitemap_locales: # special value to add nothing -> use primary language only if sitemap_locales == [None]: return [] # otherwise, add each locale return [locale for locale in sitemap_locales] # Or autodetect locales locales = [] for locale_dir in app.builder.config.locale_dirs: locale_dir = os.path.join(app.confdir, locale_dir) if os.path.isdir(locale_dir): for locale in os.listdir(locale_dir): if os.path.isdir(os.path.join(locale_dir, locale)): locales.append(locale) return locales def record_builder_type(app: Sphinx): """ Determine if the Sphinx Builder is an instance of DirectoryHTMLBuilder and store that in the application environment. :param app: The Sphinx Application instance """ # builder isn't initialized in the setup so we do it here builder = getattr(app, "builder", None) if builder is None: return builder.env.is_directory_builder = type(builder).__name__ == "DirectoryHTMLBuilder" builder.env.app.sitemap_links = Manager().Queue() def hreflang_formatter(lang: str) -> str: """ Format the supplied locale code into a string that is compatible with `hreflang`. See also: - https://en.wikipedia.org/wiki/Hreflang#Common_Mistakes - https://github.com/readthedocs/readthedocs.org/pull/5638 :param lang: The locale string to format :return: The formatted locale string """ if "_" in lang: return lang.replace("_", "-") return lang def add_html_link(app: Sphinx, pagename: str, templatename, context, doctree): """ As each page is built, collect page names for the sitemap :param app: The Sphinx Application instance :param pagename: The current page being built """ env = app.builder.env if app.builder.config.html_file_suffix is None: file_suffix = ".html" else: file_suffix = app.builder.config.html_file_suffix # Support DirectoryHTMLBuilder path structure # where generated links between pages omit the index.html if env.is_directory_builder: # type: ignore if pagename == "index": sitemap_link = "" elif pagename.endswith("/index"): sitemap_link = pagename[:-6] + "/" else: sitemap_link = pagename + "/" else: sitemap_link = pagename + file_suffix if sitemap_link not in app.builder.config.sitemap_excludes: env.app.sitemap_links.put(sitemap_link) # type: ignore def create_sitemap(app: Sphinx, exception): """ Generates the sitemap.xml from the collected HTML page links. :param app: The Sphinx Application instance """ site_url = app.builder.config.site_url or app.builder.config.html_baseurl if site_url: site_url.rstrip("/") + "/" else: logger.warning( "sphinx-sitemap: html_baseurl is required in conf.py." "Sitemap not built.", type="sitemap", subtype="configuration", ) return if app.env.app.sitemap_links.empty(): # type: ignore logger.info( "sphinx-sitemap: No pages generated for %s" % app.config.sitemap_filename, type="sitemap", subtype="information", ) return ElementTree.register_namespace("xhtml", "http://www.w3.org/1999/xhtml") root = ElementTree.Element( "urlset", xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" ) locales = get_locales(app) if app.builder.config.version: version = app.builder.config.version + "/" else: version = "" while True: try: link = app.env.app.sitemap_links.get_nowait() # type: ignore except queue.Empty: break url = ElementTree.SubElement(root, "url") scheme = app.config.sitemap_url_scheme if app.builder.config.language: lang = app.builder.config.language + "/" else: lang = "" ElementTree.SubElement(url, "loc").text = site_url + scheme.format( lang=lang, version=version, link=link ) for lang in locales: lang = lang + "/" ElementTree.SubElement( url, "{http://www.w3.org/1999/xhtml}link", rel="alternate", hreflang=hreflang_formatter(lang.rstrip("/")), href=site_url + scheme.format(lang=lang, version=version, link=link), ) filename = Path(app.outdir) / app.config.sitemap_filename ElementTree.ElementTree(root).write( filename, xml_declaration=True, encoding="utf-8", method="xml" ) logger.info( "sphinx-sitemap: %s was generated for URL %s in %s" % (app.config.sitemap_filename, site_url, filename), type="sitemap", subtype="information", ) sphinx-sitemap-2.6.0/tests/000077500000000000000000000000001461356132000156335ustar00rootroot00000000000000sphinx-sitemap-2.6.0/tests/conftest.py000066400000000000000000000011701461356132000200310ustar00rootroot00000000000000from pathlib import Path import pytest import sphinx pytest_plugins = "sphinx.testing.fixtures" # Exclude 'roots' dirs for pytest test collector collect_ignore = ["roots"] def pytest_configure(config): # before Sphinx 3.3.0, the `sphinx` marker is not registered by # the extension (but by Sphinx's internal pytest config) config.addinivalue_line("markers", "sphinx") @pytest.fixture(scope="session") def rootdir(): if sphinx.version_info[:2] < (7, 2): from sphinx.testing.path import path return path(__file__).parent.abspath() / "roots" return Path(__file__).resolve().parent / "roots" sphinx-sitemap-2.6.0/tests/roots/000077500000000000000000000000001461356132000170015ustar00rootroot00000000000000sphinx-sitemap-2.6.0/tests/roots/test-root/000077500000000000000000000000001461356132000207415ustar00rootroot00000000000000sphinx-sitemap-2.6.0/tests/roots/test-root/bar.rst000066400000000000000000000000341461356132000222340ustar00rootroot00000000000000bar === This is a bar page sphinx-sitemap-2.6.0/tests/roots/test-root/conf.py000066400000000000000000000000401461356132000222320ustar00rootroot00000000000000extensions = ["sphinx_sitemap"] sphinx-sitemap-2.6.0/tests/roots/test-root/dolor.rst000066400000000000000000000000561461356132000226130ustar00rootroot00000000000000:orphan: Dolor ===== This is the dolor page sphinx-sitemap-2.6.0/tests/roots/test-root/elitr.rst000066400000000000000000000000561461356132000226130ustar00rootroot00000000000000:orphan: Elitr ===== This is the elitr page sphinx-sitemap-2.6.0/tests/roots/test-root/foo.rst000066400000000000000000000000341461356132000222530ustar00rootroot00000000000000foo === This is a foo page sphinx-sitemap-2.6.0/tests/roots/test-root/index.rst000066400000000000000000000001131461356132000225750ustar00rootroot00000000000000test for basic sitemap ====================== .. toctree:: foo bar sphinx-sitemap-2.6.0/tests/roots/test-root/ipsum.rst000066400000000000000000000000561461356132000226310ustar00rootroot00000000000000:orphan: Ipsum ===== This is the ipsum page sphinx-sitemap-2.6.0/tests/roots/test-root/lorem.rst000066400000000000000000000000561461356132000226120ustar00rootroot00000000000000:orphan: Lorem ===== This is the lorem page sphinx-sitemap-2.6.0/tests/test_parallel_mode.py000066400000000000000000000015361461356132000220510ustar00rootroot00000000000000import os from xml.etree import ElementTree as etree import pytest @pytest.mark.sphinx( "html", freshenv=True, confoverrides={"html_baseurl": "https://example.org/docs/", "language": "en"}, ) def test_parallel(app, status, warning): app.parallel = 2 app.warningiserror = True app.build() assert "sitemap.xml" in os.listdir(app.outdir) doc = etree.parse(app.outdir / "sitemap.xml") urls = { e.text for e in doc.findall(".//{http://www.sitemaps.org/schemas/sitemap/0.9}loc") } assert urls == { f"https://example.org/docs/en/{d}.html" for d in [ "index", "foo", "bar", "lorem", "ipsum", "dolor", "elitr", "genindex", "search", ] } assert not warning.getvalue() sphinx-sitemap-2.6.0/tests/test_simple.py000066400000000000000000000061121461356132000205350ustar00rootroot00000000000000import os from xml.etree import ElementTree as etree import pytest @pytest.mark.sphinx( "html", freshenv=True, confoverrides={"html_baseurl": "https://example.org/docs/", "language": "en"}, ) def test_simple_html(app, status, warning): app.warningiserror = True app.build() assert "sitemap.xml" in os.listdir(app.outdir) doc = etree.parse(app.outdir / "sitemap.xml") urls = { e.text for e in doc.findall(".//{http://www.sitemaps.org/schemas/sitemap/0.9}loc") } assert urls == { f"https://example.org/docs/en/{d}.html" for d in [ "index", "foo", "bar", "lorem", "ipsum", "dolor", "elitr", "genindex", "search", ] } @pytest.mark.sphinx( "html", freshenv=True, confoverrides={ "html_baseurl": "https://example.org/docs/", "language": "en", "html_file_suffix": ".htm", }, ) def test_html_file_suffix(app, status, warning): app.warningiserror = True app.build() assert "sitemap.xml" in os.listdir(app.outdir) doc = etree.parse(app.outdir / "sitemap.xml") urls = { e.text for e in doc.findall(".//{http://www.sitemaps.org/schemas/sitemap/0.9}loc") } assert urls == { f"https://example.org/docs/en/{d}.htm" for d in [ "index", "foo", "bar", "lorem", "ipsum", "dolor", "elitr", "genindex", "search", ] } @pytest.mark.sphinx( "dirhtml", freshenv=True, confoverrides={"html_baseurl": "https://example.org/docs/", "language": "en"}, ) def test_simple_dirhtml(app, status, warning): app.warningiserror = True app.build() assert "sitemap.xml" in os.listdir(app.outdir) doc = etree.parse(app.outdir / "sitemap.xml") urls = { e.text for e in doc.findall(".//{http://www.sitemaps.org/schemas/sitemap/0.9}loc") } assert urls == { f"https://example.org/docs/en/{d}" for d in [ "", "foo/", "bar/", "lorem/", "ipsum/", "dolor/", "elitr/", "genindex/", "search/", ] } @pytest.mark.sphinx( "html", freshenv=True, confoverrides={ "html_baseurl": "https://example.org/docs/", "language": "en", "sitemap_excludes": ["search.html", "genindex.html"], }, ) def test_simple_excludes(app, status, warning): app.warningiserror = True app.build() assert "sitemap.xml" in os.listdir(app.outdir) doc = etree.parse(app.outdir / "sitemap.xml") urls = { e.text for e in doc.findall(".//{http://www.sitemaps.org/schemas/sitemap/0.9}loc") } assert urls == { f"https://example.org/docs/en/{d}.html" for d in [ "index", "foo", "bar", "lorem", "ipsum", "dolor", "elitr", ] } sphinx-sitemap-2.6.0/tox.ini000066400000000000000000000006771461356132000160160ustar00rootroot00000000000000[tox] envlist = py3{8,9}-sphinx{5,6,7,last} # Python 3.10 is unsupported below Sphinx4 # See https://github.com/sphinx-doc/sphinx/issues/9816 py3{10,11,12}-sphinx{5,6,7,last} [testenv] deps = pytest sphinx5: Sphinx[test]~=5.0 sphinx6: Sphinx[test]~=6.0 sphinx7: Sphinx[test]~=7.0 sphinxlast: Sphinx[test] commands = pytest -W ignore::DeprecationWarning [flake8] max-line-length = 100 extend-ignore = E203