Skip to content

Commit

Permalink
Merge branch 'main' into v2.1-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nigini authored Oct 27, 2024
2 parents c61bcd1 + 17e70d5 commit b1bc72b
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.idea
*.db
*.log
__pycache__/
.mypy_cache/
.pytest_cache/
docs/dist/
requirements.txt
app/_version.py
app/static/favicon.ico
1 change: 1 addition & 0 deletions app/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION = "2.1.0-dev"
5 changes: 3 additions & 2 deletions app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from loguru import logger
from mistletoe import markdown # type: ignore

from app._version import VERSION
from app.customization import _CUSTOM_ROUTES
from app.customization import _StreamVisibilityCallback
from app.customization import default_stream_visibility_callback
Expand All @@ -25,13 +26,14 @@

_CONFIG_FILE = os.getenv("MICROBLOGPUB_CONFIG_FILE", "profile.toml")

VERSION_COMMIT = "dev"

try:
from app._version import VERSION_COMMIT # type: ignore
except ImportError:
VERSION_COMMIT = get_version_commit()

VERSION += "+{}".format(VERSION_COMMIT)

# Force reloading cache when the CSS is updated
CSS_HASH = "none"
try:
Expand Down Expand Up @@ -69,7 +71,6 @@ def set_moved_to(moved_to: str) -> None:
MOVED_TO_FILE.write_text(moved_to)


VERSION = f"2.0.0+{VERSION_COMMIT}"
USER_AGENT = f"microblogpub/{VERSION}"
AP_CONTENT_TYPE = "application/activity+json"

Expand Down
23 changes: 11 additions & 12 deletions data/_theme.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// override vars for theming here
//$font-stack: "Inconsolata", monospace;
//$background: #ffff;
//$light-background: #f8f9fa;
//$text-color: #0d1e2d;
//$primary-color: #1d781d;
//$secondary-color: #781D78;
//$form-background-color: #f8f9fa;
//$form-text-color: #0d1e2d;
//$muted-color: #555; // solarized comment text
//$primary-button-text-color: #f8f9fa;
//$code-highlight-background: #f0f0f0;
$font-stack: "Inconsolata", monospace;
$background: #ffff;
$light-background: #f8f9fa;
$text-color: #0d1e2d;
$primary-color: #1d781d;
$secondary-color: #781D78;
$form-background-color: #f8f9fa;
$form-text-color: #0d1e2d;
$muted-color: #555; // solarized comment text
$primary-button-text-color: #f8f9fa;
$code-highlight-background: #f0f0f0;
1 change: 0 additions & 1 deletion data/templates/app

This file was deleted.

62 changes: 62 additions & 0 deletions data/templates/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<header id="header">

<div class="h-card p-author">
<data class="u-photo" value="{{ local_actor.icon_url }}"></data>
<a href="{{ local_actor.url }}" class="u-url u-uid no-hover title">
<span class="name">{{ local_actor.name }}</span>
<span class="p-name handle">{{ local_actor.handle }}</span>
</a>
<a class="label-btn follow" href="{{ local_actor.url }}remote_follow">Follow</a>

<div class="p-note summary">
{{ local_actor.summary | safe }}
</div>

<div id="profile-props">
{% for prop in local_actor.attachments %}
<dl>
{% if prop.type == "PropertyValue" %}
<dt class="muted" title="{{ prop.name }}">{{ prop.name }}</dt>
<dd>{{ prop.value | clean_html(local_actor) | safe }}</dd>
{% endif %}
</dl>
{% endfor %}
</div>

</div>

{%- macro header_link(url, text) -%}
{% set url_for = BASE_URL + request.app.router.url_path_for(url) %}
<a href="{{ url_for }}" {% if BASE_URL + request.url.path == url_for %}class="active"{% endif %}>{{ text }}</a>
{% endmacro %}

{%- macro navbar_item_link(navbar_item) -%}
{% set url_for = BASE_URL + navbar_item[0] %}
<a href="{{ navbar_item[0] }}" {% if BASE_URL + request.url.path == url_for %}class="active"{% endif %}>{{ navbar_item[1] }}</a>
{% endmacro %}

<div class="public-top-menu">
<nav class="flexbox" hx-boost="true" hx-indicator="body">
<ul>
{% if NAVBAR_ITEMS.INDEX_NAVBAR_ITEM %}
<li>{{ navbar_item_link(NAVBAR_ITEMS.INDEX_NAVBAR_ITEM) }}</li>
{% endif %}
<li>{{ header_link("index", "Notes") }}</li>
{% if articles_count %}
<li>{{ header_link("articles", "Articles") }} <span class="counter">{{ articles_count }}</span></li>
{% endif %}
{% if not HIDES_FOLLOWERS or is_admin %}
<li>{{ header_link("followers", "Followers") }} <span class="counter">{{ followers_count }}</span></li>
{% endif %}
{% if not HIDES_FOLLOWING or is_admin %}
<li>{{ header_link("following", "Following") }} <span class="counter">{{ following_count }}</span></li>
{% endif %}
{% for navbar_item in NAVBAR_ITEMS.EXTRA_NAVBAR_ITEMS %}
{{ navbar_item_link(navbar_item) }}
{% endfor %}
</ul>
</nav>
</div>


</header>

0 comments on commit b1bc72b

Please sign in to comment.