13 Commits

Author SHA1 Message Date
0f19fcb174 fix bad copy and paste job on link styles 2022-09-16 14:16:13 -05:00
f1684a57a9 requirements recompile 2022-09-16 13:49:57 -05:00
83eb464be9 style the potential for links in the footer 2022-09-16 13:40:23 -05:00
0f03ad6f38 allow pages to supply extra footer text 2022-09-16 13:35:40 -05:00
21ea24ffa1 header style tweaks, deemphasizing it a bit 2022-06-05 21:30:49 -05:00
724a2240b2 requirements bump for latest release 2022-05-25 07:24:03 -05:00
aa6a27dd8b make the header bigger, and align header and content padding better 2022-05-17 07:57:23 -05:00
c80172cffd go back to red headers and links as normal-colored text
the new way to do the links without adding links to images is probably
dumb and/or missing some stuff, but it works and does what I want, and I
think I like the old look of the colors better, so time to try it and
see if it sticks still
2022-05-17 07:57:23 -05:00
89ea2fb87e give the header nav links an underline on hover 2022-05-17 07:57:23 -05:00
8ac5b25208 get rid of the slight recoloring of bold text 2022-05-17 07:57:23 -05:00
54b953f5ed go back to the old, balanced width alignments 2022-05-17 07:57:23 -05:00
de0641b08f tweak the two-tone backgrounds and whitespace up the header 2022-05-17 07:57:23 -05:00
cc3e311738 clarify my DCO-like stance, and provide cloning info 2022-05-17 07:52:58 -05:00
10 changed files with 173 additions and 116 deletions

View File

@@ -1,7 +1,10 @@
# How to Contribute
incorporeal-cms is a personal project seeking to implement a simpler, cleaner form of what would
commonly be called a "CMS". I appreciate any help in making incorporeal-cms better.
commonly be called a "CMS". I appreciate any help in making it better.
incorporeal-cms is made available under the GNU Affero General Public License version 3, or any
later version.
## Opening Issues
@@ -10,8 +13,24 @@ Issues should be posted to my Gitea instance at
recommend starting the title with "Improvement:", "Bug:", or similar, so I can do a high level of
prioritization.
## Guidelines for Patches, etc.
## Contributions
I don't expect contributors to sign up for my personal Gitea in order to send contributions, but it
of course makes it easier. If you wish to go this route, please sign up at
<https://git.incorporeal.org/bss/incorporeal-cms> and fork the project. People planning on
contributing often are also welcome to request access to the project directly.
Otherwise, contact me via any means you know to reach me at, or <bss@incorporeal.org>, to discuss
your change and to tell me how to pull your changes.
### Guidelines for Patches, etc.
* Cloning
* Clone the project. I would advise using a pull-based workflow where I have access to the hosted
repository --- using my Gitea, cloning to a public GitHub, etc. --- rather than doing this over
email, but that works too if we must.
* Make your contributions in a new branch, generally off of `master`.
* Send me a pull request when you're ready, and we'll go through a code review.
* Code:
* Keep in mind that I strive for simplicity in the software. It serves files and renders
Markdown, that's pretty much it. Features around that function are good; otherwise, I need
@@ -27,22 +46,31 @@ prioritization.
* Squash tiny commits if you'd like. I prefer commits that make one atomic conceptual change
that doesn't affect the rest of the code, assembling multiple of those commits into larger
changes.
* Follow something like [Chris Beams'](https://chris.beams.io/posts/git-commit/) post on
* Follow something like [Chris Beams's post](https://chris.beams.io/posts/git-commit/) on
formatting a good commit message.
* Please make sure your Author contact information is stable, in case I need to reach you.
* Consider cryptographically signing (`git commit -S`) your commits.
## Contributions
### Custody of Contributions
I don't expect contributors to sign up for my personal Gitea in order to send contributions, but it
of course makes it easier. If you wish to go this route, please sign up at
<https://git.incorporeal.org/bss/incorporeal-cms> and fork the project. People planning on
contributing often are also welcome to request access to the project directly.
I do not request the copyright of contributions be assigned to me or to the project, and I require no
provision that I be allowed to relicense your contributions. My personal oath is to maintain
inbound=outbound in my open source projects, and the expectation is authors are responsible for their
contributions.
Otherwise, contact me via any means you know to reach me at, or <bss@incorporeal.org>, to discuss
your change and to tell me how to pull your changes.
I am following the *spirit* of the [Developer Certificate of Origin](https://developercertificate.org/),
but in a simplified fashion:
### Copyright of Contributions
By making a contribution to this project, you certify that:
Accepted changes remain the copyright of the original author, but please include appropriate contact
methods in the event I choose to provide the project under a new license and need to contact you
to approve the new license terms. Please note that the software is provided under the GNU AGPLv3 (or
later).
1. The contribution was created by you and you have the right to submit it under the open source license
indicated in the LICENSE file; or
2. The contribution is based upon previous work that is covered under an appropriate open source license
compatible with the license indicated in the LICENSE file, and you have the right to contribute that
work with or without modifications, under the terms of that same open source license; or
3. The contribution was provided directly to you by some other person who certified points 1, 2, or 3, and
you have not modified it.
In the event of point 3, your commit **must** include the Signed-off-by line(s) as a chain of custody,
via `git commit -s`. For points 1 and 2, your commit with accurate Author information doubles as direct
custody.

View File

@@ -76,6 +76,8 @@ def handle_markdown_file_path(resolved_path):
page_title = f'{page_name} - {app.config["TITLE_SUFFIX"]}' if page_name else app.config['TITLE_SUFFIX']
logger.debug("title (potentially derived): %s", page_title)
extra_footer = get_meta_str(md, 'footer') if md.Meta.get('footer') else None
template = get_meta_str(md, 'template') if md.Meta.get('template') else 'base.html'
# check if this has a HTTP redirect
@@ -86,7 +88,8 @@ def handle_markdown_file_path(resolved_path):
return render(template, title=page_title, description=get_meta_str(md, 'description'),
image=get_meta_str(md, 'image'), base_url=request.base_url, content=content,
navs=parent_navs, mtime=mtime.strftime('%Y-%m-%d %H:%M:%S %Z'))
navs=parent_navs, mtime=mtime.strftime('%Y-%m-%d %H:%M:%S %Z'),
extra_footer=extra_footer)
def request_path_to_instance_resource_path(path):

View File

@@ -12,11 +12,11 @@ body {
}
.site-wrap-normal-width {
max-width: 80pc;
max-width: 65pc;
}
.site-wrap-double-width {
max-width: 160pc;
max-width: 130pc;
}
.site-wrap {
@@ -34,8 +34,9 @@ a {
div.header {
display: flex;
justify-content: space-between;
font-size: 0.75em;
padding: 0.5em 1em;
font-size: 0.8em;
padding: 1rem 1rem;
padding-bottom: 0;
}
div.header a {
@@ -44,17 +45,10 @@ div.header a {
div.content {
font-size: 11pt;
padding: 0 1em;
padding: 0 1rem;
line-height: 1.6em;
}
@media only screen and (min-width: 70pc) {
div.content, footer {
margin-left: 5pc;
margin-right: 5pc;
}
}
div.content p {
margin: 1.25em 0;
}
@@ -78,6 +72,10 @@ footer {
margin-top: 30px;
}
.extra-footer {
margin-bottom: 5px;
}
table {
border-collapse: collapse;
}

View File

@@ -6,34 +6,38 @@ html {
}
body {
background: #090909;
background: #111;
}
strong {
color: #EEE;
}
.site-wrap {
background: black;
}
a:link, a:visited {
h1, h2, h3, h4, h5, h6 {
color: #B31D15;
}
a:hover, a:active {
p a, ul a, ol a {
color: #DDD;
border-bottom: 1px solid #DDD;
}
footer a {
color: #999;
border-bottom: 1px solid #999;
}
p a:hover, ul a:hover, ol a:hover, footer a:hover {
color: #B31D15;
border-bottom: 1px solid #B31D15;
}
div.header {
background: #222;
border-bottom: 1px solid #222;
color: #BBB;
div.site-wrap {
background: black;
}
div.header a {
color: #BBB;
div.header, div.header a {
color: #555;
}
div.header a:hover, div.header a:active {
border-bottom: 1px solid #555;
}
table, th, td {

View File

@@ -6,34 +6,38 @@ html {
}
body {
background: #F6F6F6;
background: #EEE;
}
strong {
color: #111;
h1, h2, h3, h4, h5, h6 {
color: #811610;
}
.site-wrap {
p a, ul a, ol a {
color: #222;
border-bottom: 1px solid #222;
}
footer a {
color: #999;
border-bottom: 1px solid #999;
}
p a:hover, ul a:hover, ol a:hover, footer a:hover {
color: #811610;
border-bottom: 1px solid #811610;
}
div.site-wrap {
background: white;
}
a:link, a:visited {
color: #811610;
div.header, div.header a {
color: #AAA;
}
a:hover, a:active {
color: #811610;
border-bottom: 1px solid #B31D15;
}
div.header {
background: #DDD;
border-bottom: 1px solid #DDD;
color: #444;
}
div.header a {
color: #444;
div.header a:hover, div.header a:active {
border-bottom: 1px solid #AAA;
}
table, th, td {

View File

@@ -31,7 +31,8 @@
{{ content }}
</div>
<footer>
<i>Last modified: {{ mtime }}</i>
{% if extra_footer %}<div class="extra-footer"><i>{{ extra_footer|safe }}</i></div>{% endif %}
<div class="footer"><i>Last modified: {{ mtime }}</i></div>
</footer>
{% endblock %}
</div>

View File

@@ -4,32 +4,34 @@
#
# pip-compile --output-file=requirements/requirements-dev.txt requirements/requirements-dev.in
#
attrs==21.4.0
attrs==22.1.0
# via pytest
bandit==1.7.4
# via -r requirements/requirements-dev.in
certifi==2021.10.8
build==0.8.0
# via pip-tools
certifi==2022.9.14
# via requests
charset-normalizer==2.0.12
charset-normalizer==2.1.1
# via requests
click==8.1.2
click==8.1.3
# via
# flask
# pip-tools
# safety
coverage[toml]==6.3.2
coverage[toml]==6.4.4
# via pytest-cov
distlib==0.3.4
distlib==0.3.6
# via virtualenv
dlint==0.12.0
dlint==0.13.0
# via -r requirements/requirements-dev.in
dparse==0.5.1
dparse==0.6.0
# via safety
filelock==3.6.0
filelock==3.8.0
# via
# tox
# virtualenv
flake8==4.0.1
flake8==5.0.4
# via
# -r requirements/requirements-dev.in
# dlint
@@ -48,19 +50,19 @@ flake8-executable==2.1.1
# via -r requirements/requirements-dev.in
flake8-fixme==1.1.1
# via -r requirements/requirements-dev.in
flake8-isort==4.1.1
flake8-isort==4.2.0
# via -r requirements/requirements-dev.in
flake8-logging-format==0.6.0
flake8-logging-format==0.7.5
# via -r requirements/requirements-dev.in
flake8-mutable==1.2.0
# via -r requirements/requirements-dev.in
flask==2.1.1
flask==2.2.2
# via -r requirements/requirements.in
gitdb==4.0.9
# via gitpython
gitpython==3.1.27
# via bandit
idna==3.3
idna==3.4
# via requests
iniconfig==1.1.1
# via pytest
@@ -68,25 +70,28 @@ isort==5.10.1
# via flake8-isort
itsdangerous==2.1.2
# via flask
jinja2==3.1.1
jinja2==3.1.2
# via flask
markdown==3.3.6
markdown==3.4.1
# via -r requirements/requirements.in
markupsafe==2.1.1
# via jinja2
mccabe==0.6.1
# via
# jinja2
# werkzeug
mccabe==0.7.0
# via flake8
packaging==21.3
# via
# build
# dparse
# pytest
# safety
# tox
pbr==5.8.1
pbr==5.10.0
# via stevedore
pep517==0.12.0
# via pip-tools
pip-tools==6.6.0
pep517==0.13.0
# via build
pip-tools==6.8.0
# via -r requirements/requirements-dev.in
platformdirs==2.5.2
# via virtualenv
@@ -98,66 +103,64 @@ py==1.11.0
# via
# pytest
# tox
pycodestyle==2.8.0
pycodestyle==2.9.1
# via flake8
pydocstyle==6.1.1
# via flake8-docstrings
pydot==1.4.2
# via -r requirements/requirements-dev.in
pyflakes==2.4.0
pyflakes==2.5.0
# via flake8
pyparsing==3.0.8
pyparsing==3.0.9
# via
# packaging
# pydot
pytest==7.1.1
pytest==7.1.3
# via
# -r requirements/requirements-dev.in
# pytest-cov
pytest-cov==3.0.0
# via -r requirements/requirements-dev.in
pyyaml==6.0
# via
# bandit
# dparse
requests==2.27.1
# via bandit
requests==2.28.1
# via safety
safety==1.10.3
ruamel-yaml==0.17.21
# via safety
ruamel-yaml-clib==0.2.6
# via ruamel-yaml
safety==2.1.1
# via -r requirements/requirements-dev.in
six==1.16.0
# via
# tox
# virtualenv
# via tox
smmap==5.0.0
# via gitdb
snowballstemmer==2.2.0
# via pydocstyle
stevedore==3.5.0
stevedore==4.0.0
# via bandit
testfixtures==6.18.5
# via flake8-isort
toml==0.10.2
# via
# dparse
# tox
# via dparse
tomli==2.0.1
# via
# build
# coverage
# pep517
# pytest
tox==3.25.0
# tox
tox==3.26.0
# via
# -r requirements/requirements-dev.in
# tox-wheel
tox-wheel==0.7.0
# via -r requirements/requirements-dev.in
urllib3==1.26.9
urllib3==1.26.12
# via requests
versioneer==0.22
versioneer==0.26
# via -r requirements/requirements-dev.in
virtualenv==20.14.1
virtualenv==20.16.5
# via tox
werkzeug==2.1.1
werkzeug==2.2.2
# via flask
wheel==0.37.1
# via

View File

@@ -4,17 +4,19 @@
#
# pip-compile --output-file=requirements/requirements.txt requirements/requirements.in
#
click==8.1.2
click==8.1.3
# via flask
flask==2.1.1
flask==2.2.2
# via -r requirements/requirements.in
itsdangerous==2.1.2
# via flask
jinja2==3.1.1
jinja2==3.1.2
# via flask
markdown==3.3.6
markdown==3.4.1
# via -r requirements/requirements.in
markupsafe==2.1.1
# via jinja2
werkzeug==2.1.1
# via
# jinja2
# werkzeug
werkzeug==2.2.2
# via flask

View File

@@ -210,3 +210,11 @@ def test_pages_can_supply_alternate_templates(client):
response = client.get('/custom-template')
assert b'class="site-wrap site-wrap-normal-width"' not in response.data
assert b'class="site-wrap site-wrap-double-width"' in response.data
def test_extra_footer_per_page(client):
"""Test that we don't include the extra-footer if there isn't one (or do if there is)."""
response = client.get('/')
assert b'<div class="extra-footer">' not in response.data
response = client.get('/index-but-with-footer')
assert b'<div class="extra-footer"><i>ooo <a href="a">a</a></i>' in response.data

View File

@@ -0,0 +1,6 @@
Title: Index
Footer: ooo <a href="a">a</a>
# test index
this is some test content