Skip to main content

Keep all your website's pages under one template

Project description

AutoSite

AutoSite helps you keep all of your website's pages in the same basic template. Managing a navigation bar, a footer, and even meta/OpenGraph tags across several pages is simple.

You can try AutoSite right in your browser!

Prerequisites

  • Python 3
  • BeautifulSoup 4 (pip3 install beautifulsoup4)

Usage

-1. Install the prerequisites with pip. pip3 install -r requirements.txt

  1. Run the script, AutoSite.py. It will create a basic default.html template and the in and includes folders.

  2. Edit templates/default.html, filling in with these tags:

        [#content#] - The page's content.
        [#path#] - The relative file path from root.
        [#root#] - Use this to point to the site's root folder.
    

    You can also use any other attributes, like [#title#] or [#description#], provided that you define them in each page as below.

  3. Add your pages to the "in" folder. You can define a title and description, or any other attributes you wish, and tell AutoSite which template to use for the page at the top of the file like so:

        <!-- attrib title: Your title -->
        <!-- attrib description: Your description -->
        <!-- attrib template: default -->
        <p>Everything under the above lines will replace [#content#] in template.html.</p>
    

    Put other site files in the "includes" folder. Input pages can be HTML or Markdown files, and use the same attribute syntax.

  4. Run the script. How long it takes depends on how large your site is. Your pages will be in the "out" folder.

Conditional text

Many sites have a navigation where if you're on a page, that page's name in the navigation is not a link. AutoSite has a feature that lets you replicate this. Consider the following example:

  [path!=index.html]<a href="../index.html">[/path!=]
      Home
  [path!=index.html]</a>[/path!=]

You can also omit the ! symbol and it will only show if it is that page, like this:

  [path=index.html]<p>[/path!=]
      This is the index page.
  [path=index.html]<p>[/path!=]

Conditional text is not limited to just file paths! Nearly any attribute can be used with conditional text.

However, Conditional text still has some issues. You can only have one instance of conditional text per line, it is not nestable, and not multiline either.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

AutoSite-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

AutoSite-1.0.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file AutoSite-1.0.0.tar.gz.

File metadata

  • Download URL: AutoSite-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for AutoSite-1.0.0.tar.gz
Algorithm Hash digest
SHA256 07b82e48b165e118b518ffd3e7e80d54ae8f6738b8eb0da993a601709c698c4b
MD5 32f933a5d6550b602799b3aed2d8de3f
BLAKE2b-256 ddccb5bb769879bdf0c84b4e94e173ecc3f36044ac7bae2f7cf1e35fe2751d56

See more details on using hashes here.

File details

Details for the file AutoSite-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: AutoSite-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for AutoSite-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6529fec498427487e4067861e72b0a372ac650d0888fcc4caf914a9f648257c4
MD5 67a38bcbaba30cb401b59c5af65212bf
BLAKE2b-256 a7c9cccf93ba2e4a0f39ea7806f8aa7595e589cb7134e16560226df83cac7010

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page