htmd

Write Markdown and Jinja2 templates to create a website

https://github.com/siecje/htmd

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.6%) to scientific vocabulary

Keywords

blog-engine static-site static-site-generator
Last synced: 9 months ago · JSON representation

Repository

Write Markdown and Jinja2 templates to create a website

Basic Info
  • Host: GitHub
  • Owner: Siecje
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 145 KB
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • Open Issues: 12
  • Releases: 5
Topics
blog-engine static-site static-site-generator
Created over 11 years ago · Last pushed almost 2 years ago
Metadata Files
Readme Changelog License

README.md

htmd

htmd allows you to write Markdown and use templates to create a static website. Yes it is another static site generator.

Why another static site generator?

I admit I didn't try them all. I tried several static site generators written in Python, but I found them complicated. Some static site generators I tried created a template website with content on the home page but the index.html file had no content. It should be obvious where to find the content.

  • I don't like starting with a lot of folders and files
  • I want all blog posts in the same folder because it is easier to work with. I want the URL structure for each post to include the date (/2015/01/31/post-title), without having to create a folder for each year and month.
  • I don't want to include all of the templates being used, only overwrite the ones I modified.
  • I want it to be obvious where to find the content.
  • I want it to be obvious how to set a value to use in multiple templates.
  • If you made changes to one of your templates and ran build you wouldn't update existing files unless you deleted your build folder everytime.

I believe the reason there are so many static site generators is people are picky about their workflow and that's okay. This is also a great way to stay up to date with Packaging in Python.

What is the difference between posts and pages?

Posts are blog posts with dates and authors tracked by feeds. Pages are other webpages on the site, for example the About page.

How do I edit the layout of the site?

Edit the templates/_layout.html file that was created when running htmd start. This a Jinja 2 template that all other pages will use by default. You can add a link to CSS file that you have created in static/. To change other pages you will need to override the page template by creating a file with the same name in the templates/ folder. The complete list of templates can be found here.

How do drafts work?

A post will be a draft if draft: true is set in the metadata and will not appear in the build folder. If draft: build is set then the post page will be in the build but the post will not appear in any list pages. When a draft is built the metadata value will contain a UUID of where the post is available.

For example, if the draft metadata is draft: build|f47d4d98-9d66-448a-9e08-7b5c2032e558 then the post will served at /draft/f47d4d98-9d66-448a-9e08-7b5c2032e558/index.html.

To view the site as if all drafts were published run htmd preview --drafts.

Getting Started

shell $ pip install htmd

shell Commands: start Create example files to get started. verify Verify posts formatting is correct. build Create static version of the site. preview Serve files to preview site. templates Create any missing templates

Development

Running the development version locally

```shell $ git clone https://github.com/Siecje/htmd.git $ python3 -m venv venv $ venv/bin/python -m pip install pip setuptools --upgrade $ venv/bin/python -m pip install -e htmd/[dev]

You can now make changes inside htmd/ without having to re-install

$ mkdir mysite $ cd mysite $ ../venv/bin/htmd start

You can also create a symlink to htmd

somewhere on your $PATH and just use htmd start

$ ../venv/bin/htmd build ```

Running mypy

shell $ venv/bin/python -m mypy .

Running ruff

shell $ venv/bin/python -m ruff check --exclude typehints

Running the tests

shell $ git clone https://github.com/Siecje/htmd.git $ cd htmd $ python3 -m venv venv $ venv/bin/python -m pip install pip setuptools --upgrade $ venv/bin/python -m pip install -e .[dev] $ venv/bin/python -m pytest .

Running the tests with coverage.py

shell $ venv/bin/coverage run --branch -m pytest . $ venv/bin/coverage html --omit='/private/*' $ open htmlcov/index.html

Owner

  • Name: Cody Scott
  • Login: Siecje
  • Kind: user

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 64
  • Total Committers: 1
  • Avg Commits per committer: 64.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Cody Scott c****t@g****m 64

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 19
  • Total pull requests: 16
  • Average time to close issues: 11 months
  • Average time to close pull requests: 4 minutes
  • Total issue authors: 1
  • Total pull request authors: 3
  • Average comments per issue: 0.32
  • Average comments per pull request: 0.13
  • Merged pull requests: 12
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • Siecje (21)
Pull Request Authors
  • Siecje (23)
  • dependabot[bot] (2)
  • srmcgann (1)
Top Labels
Issue Labels
Pull Request Labels
dependencies (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 76 last-month
  • Total dependent packages: 1
  • Total dependent repositories: 2
  • Total versions: 14
  • Total maintainers: 1
pypi.org: htmd

Write Markdown and Jinja2 templates to create a website

  • Versions: 14
  • Dependent Packages: 1
  • Dependent Repositories: 2
  • Downloads: 76 Last month
Rankings
Dependent packages count: 10.1%
Dependent repos count: 11.5%
Downloads: 12.1%
Average: 18.3%
Stargazers count: 27.8%
Forks count: 29.8%
Maintainers (1)
Last synced: 9 months ago

Dependencies

requirements.txt pypi
  • Flask ==2.0.3
  • Flask-FlatPages ==0.8.1
  • Frozen-Flask ==0.18
  • Pygments ==2.11.2
  • beautifulsoup4 ==4.10.0
  • click ==8.0.4
  • csscompressor ==0.9.5
  • feedwerk ==1.0.0
  • htmlmin ==0.1.12
  • jsmin ==3.0.1
.github/workflows/python-package.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
  • Flask *
  • Flask-FlatPages *
  • Frozen-Flask *
  • Pygments *
  • beautifulsoup4 *
  • click *
  • csscompressor *
  • feedwerk *
  • htmlmin *
  • jsmin *