Move logos to admin theme
- Fix web log SQLite update - Fix post SQLite retrieval - WIP on default theme
This commit is contained in:
parent
2daf385730
commit
a4bdac7b55
|
@ -1046,15 +1046,12 @@ type SQLiteData (conn : SqliteConnection) =
|
|||
cmd.CommandText <- "SELECT * FROM post WHERE id = @id"
|
||||
cmd.Parameters.AddWithValue ("@id", PostId.toString postId) |> ignore
|
||||
use! rdr = cmd.ExecuteReaderAsync ()
|
||||
if rdr.Read () then
|
||||
match verifyWebLog<Post> webLogId (fun p -> p.webLogId) Map.toPost rdr with
|
||||
| Some post ->
|
||||
let! post = appendPostCategoryTagAndMeta post
|
||||
let! post = appendPostRevisionsAndPermalinks post
|
||||
return Some post
|
||||
| None ->
|
||||
return None
|
||||
else
|
||||
match verifyWebLog<Post> webLogId (fun p -> p.webLogId) Map.toPost rdr with
|
||||
| Some post ->
|
||||
let! post = appendPostCategoryTagAndMeta post
|
||||
let! post = appendPostRevisionsAndPermalinks post
|
||||
return Some post
|
||||
| None ->
|
||||
return None
|
||||
}
|
||||
|
||||
|
@ -1690,7 +1687,7 @@ type SQLiteData (conn : SqliteConnection) =
|
|||
time_zone = @timeZone,
|
||||
auto_htmx = @autoHtmx,
|
||||
feed_enabled = @feedEnabled,
|
||||
feed_name = @feedName
|
||||
feed_name = @feedName,
|
||||
items_in_feed = @itemsInFeed,
|
||||
category_enabled = @categoryEnabled,
|
||||
tag_enabled = @tagEnabled,
|
||||
|
@ -1705,7 +1702,7 @@ type SQLiteData (conn : SqliteConnection) =
|
|||
cmd.CommandText <-
|
||||
"""UPDATE web_log
|
||||
SET feed_enabled = @feedEnabled,
|
||||
feed_name = @feedName
|
||||
feed_name = @feedName,
|
||||
items_in_feed = @itemsInFeed,
|
||||
category_enabled = @categoryEnabled,
|
||||
tag_enabled = @tagEnabled,
|
||||
|
|
|
@ -52,7 +52,9 @@
|
|||
<footer class="position-fixed bottom-0 w-100">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-end"><img src="/img/logo-light.png" alt="myWebLog" width="120" height="34"></div>
|
||||
<div class="col-xs-12 text-end">
|
||||
<img src="{{ "themes/admin/logo-light.png" | relative_link }}" alt="myWebLog" width="120" height="34">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 text-end">
|
||||
<img src="{{ "img/logo-light.png" | relative_link }}" alt="myWebLog" width="120" height="34">
|
||||
<img src="{{ "themes/admin/logo-light.png" | relative_link }}" alt="myWebLog" width="120" height="34">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
@ -43,4 +43,16 @@
|
|||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<nav aria-label="pagination">
|
||||
<ul class="pager">
|
||||
{% if model.newer_link -%}
|
||||
<li class="previous item"><a href="{{ model.newer_link.value }}">« Newer Posts</a></li>
|
||||
{%- else -%}
|
||||
<li></li>
|
||||
{% endif %}
|
||||
{% if model.older_link -%}
|
||||
<li class="next item"><a href="{{ model.older_link.value }}">Older Posts »</a></li>
|
||||
{%- endif -%}
|
||||
</ul>
|
||||
</nav>
|
||||
</section>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<footer>
|
||||
<hr>
|
||||
<div class="container-fluid text-end">
|
||||
<img src="/img/logo-dark.png" alt="myWebLog">
|
||||
<img src="{{ "themes/admin/logo-dark.png" | relative_link }}" alt="myWebLog">
|
||||
</div>
|
||||
</footer>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
|
||||
|
|
77
src/default-theme/single-post.liquid
Normal file
77
src/default-theme/single-post.liquid
Normal file
|
@ -0,0 +1,77 @@
|
|||
{%- assign post = model.posts | first -%}
|
||||
<div class="content single">
|
||||
<article class="item">
|
||||
<h1 class="item-heading">{{ post.title }}</h1>
|
||||
<h4 class="post-meta">
|
||||
{% if post.published_on -%}
|
||||
<span title="Published On">
|
||||
<i class="fa fa-calendar"></i> {{ post.published_on | date: "dddd, MMMM d, yyyy" }}
|
||||
</span>
|
||||
<span title="Published At">
|
||||
<i class="fa fa-clock-o"></i> {{ post.published_on | date: "h:mm tt" | downcase }}
|
||||
</span>
|
||||
{%- else -%}
|
||||
<span>**DRAFT**</span>
|
||||
{% endif %}
|
||||
<span title="Author"><i class="fa fa-user"></i> {{ model.authors | value: post.author_id }}</span>
|
||||
{% if logged_on %}
|
||||
<span>
|
||||
<a hx-boost="false" href="{{ post | edit_post_link }}">
|
||||
<i class="fa fa-pencil-square-o"></i> Edit Post
|
||||
</a>
|
||||
</span>
|
||||
{% endif %}
|
||||
</h4>
|
||||
<div>{{ post.text }}</div>
|
||||
{%- assign cat_count = post.category_ids | size -%}
|
||||
{% if cat_count > 0 -%}
|
||||
<h4>
|
||||
Categorized
|
||||
{% for cat_id in post.category_ids -%}
|
||||
{% assign cat = categories | where: "id", cat_id | first %}
|
||||
<span class="no-wrap">
|
||||
<i class="fa fa-folder-open-o" title="Category"></i>
|
||||
<a href="{{ cat | category_link }}" title="Categorized under “{{ cat.name | escape }}”">
|
||||
{{ cat.name }}
|
||||
</a>
|
||||
</span>
|
||||
{%- endfor %}
|
||||
</h4>
|
||||
{%- endif %}
|
||||
{%- assign tag_count = post.tags | size -%}
|
||||
{% if tag_count > 0 -%}
|
||||
<h4>
|
||||
Tagged
|
||||
{% for tag in post.tags %}
|
||||
<span class="no-wrap">
|
||||
<a href="{{ tag | tag_link }}" title="Posts tagged “{{ tag | escape }}”" rel="tag">
|
||||
<i class="fa fa-tag"></i> {{ tag }}
|
||||
</a>
|
||||
</span>
|
||||
{%- endfor %}
|
||||
</h4>
|
||||
{%- endif %}
|
||||
</article>
|
||||
<div>
|
||||
<nav aria-label="pagination">
|
||||
<ul class="pager">
|
||||
{% if model.newer_link -%}
|
||||
<li class="previous item">
|
||||
<h4 class="item-heading">
|
||||
<a href="{{ model.newer_link.value | relative_link }}">«</a> Previous Post
|
||||
</h4>
|
||||
<a href="{{ model.newer_link.value | relative_link }}">{{ model.newer_name.value }}</a>
|
||||
</li>
|
||||
{%- else -%}
|
||||
<li></li>
|
||||
{% endif %}
|
||||
{% if model.older_link -%}
|
||||
<li class="next item">
|
||||
<h4 class="item-heading">Next Post <a href="{{ model.older_link.value | relative_link }}">»</a></h4>
|
||||
<a href="{{ model.older_link.value | relative_link }}">{{ model.older_name.value }}</a>
|
||||
</li>
|
||||
{%- endif -%}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
2
src/default-theme/version.txt
Normal file
2
src/default-theme/version.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
myWebLog Default Theme
|
||||
2.0.0-alpha36
|
Loading…
Reference in New Issue
Block a user