Commit e9f52f76 authored by Denis Salem's avatar Denis Salem
Browse files

fix tessellation spacing and navigation, add extra pattern, need to be tested

parent b96a0735
......@@ -161,6 +161,9 @@ cd # version 1.0.0 Last minute edition :p
DONE | Theme must have it's own yaml configuration.
DONE | Fix pattern processing within included file.
DONE | Add ForEntryMetadata
DONE | Add ForEntryRange
TODO | Use built in list in yaml instead to turn str to list.
WIP | Reorganize themes dependencies in setup.
TODO | Include threads preview in entry
TODO | Add command for reorder entries by criteria
......@@ -172,6 +175,7 @@ cd # version 1.0.0 Last minute edition :p
TODO | Change nomenclature: Most of the usual patterns are changed. Fix doc.
# version 2.1.x
TODO | Warn about metadata that should be list but are str.
TODO | Add folder for blog_configuration, with multiple configuration file (for splitting the actual one).
TODO | Automatically merge all known entry authors into blog authors.
TODO | Force preview / full content in thread, for single entry.
......
......@@ -7,13 +7,16 @@ body, html
font-family: sans;
font-weight: lighter;
background-color: white;}
p
{padding: 0px;}
a
{outline: none;
text-decoration: none;
color: black;
transition: 0.5s ease all;
opacity: 0.5;}
opacity: 0.9;}
a:hover
{opacity:1.0;}
......@@ -102,14 +105,28 @@ math
{max-width: 100%;
display: inline-block;
margin: auto;}
.entry p:last-of-type
{margin-bottom: 0px;}
.entry p:first-of-type
{margin-top: 0px;}
.permalink
{display: block;
width: 100%;
margin-top: 1em;
margin-bottom: 1em;
height: 0px;
opacity: 0;
margin-bottom: 5px;
text-align: center;
font-size: 1em;}
font-size: 1em;
background-color: white;
overflow-y: hidden;
transition: 0.5s ease all;}
.entry:hover .permalink
{height: 1em;
opacity: 1;}
/***************/
/* F O O T E R */
......@@ -118,6 +135,9 @@ math
footer
{padding: 1em;
font-size: 1.25em;
margin: auto;
margin-bottom: 1em;
max-width: 800px;
text-align: center;}
footer #pagesList
......@@ -133,6 +153,12 @@ footer a
footer #pagesList li, #previous, #next
{display: inline-block;}
#previous
{float: left;}
#next
{float: right;}
/***************/
/* L A Y O U T */
/***************/
......
.__VENC_COLUMN__
{width: 30%;
{width: 31%;
display: inline-block;
margin:1.25%;
margin:0.41%;
vertical-align: top;}
</div>
<footer id="__VENC_NAVIGATION__">
<hr>
.:GetPreviousPage:: <a id="previous" href="{path} ">{entry_title} ←</a>:.
<ul id="pagesList">.:ForPages::5::<li><a href="{path}">{page_number}</a></li>:: . :.</ul>
.:IfInThread::<ul id="pagesList">.:ForPages::5::<li><a href="{path}">{page_number}</a></li>:: . :.</ul>:: :.
.:GetNextPage:: <a id="next" href="{path} " data-venc-api-infinite-scroll-hook="{path}">→ {entry_title}</a>:.
</footer>
</body>
......
......@@ -7,7 +7,7 @@
<meta name="keywords" content=".:GetBlogKeywords:." />
<meta name="description" content=".:GetBlogDescription:." />
<meta charset="utf-8" />
<script type="text/javascript" src=".:GetRelativeOrigin:.VenC-Infinite-Scroll-1.1.0.js"></script>
.:IfInThread::<script type="text/javascript" src=".:GetRelativeOrigin:.VenC-Infinite-Scroll-1.1.0.js"></script>:: :.
<script type="text/javascript">
window.onload = VENC_INFINITE_SCROLL_ON_LOAD;
</script>
......
......@@ -488,6 +488,8 @@ class DataStore:
def get_entry_metadata(self, argv):
# if exception is raised it will be automatically be catch by processor.
getattr(self.entries[self.requested_entry_index], argv[0])
return str(getattr(self.entries[self.requested_entry_index], argv[0]))
def get_entry_metadata_if_exists(self, argv):
......@@ -674,12 +676,48 @@ class DataStore:
return self.html_categories_tree[key]
def for_entry_range(self, argv):
if len(argv) != 3:
raise PatternMissingArguments(expected=2,got=len(argv))
try:
start_from= int(argv[0])
except TypeError:
raise GenericMessage(
messages.wrong_pattern_argument.format("start_from", argv[0])+' '+
messages.pattern_argument_must_be_integer
)
try:
end_from= int(argv[1])
except TypeError:
raise GenericMessage(
messages.wrong_pattern_argument.format("end_to", argv[0])+' '+
messages.pattern_argument_must_be_integer
)
if end_from <= start_from:
raise GenericMessage(messages.invalid_range.format(start_from, end_to))
entry = self.entries[self.requested_entry_index]
output = ""
#TODO: PREVENT CRASH IN CASE OF WRONG INPUTS
for i in range(start_from, end_from):
output += argv[2].replace("[index]}", '['+str(i)+']}').format(**entry.raw_metadata)
return output
def for_entry_tags(self, argv):
key = ''.join(argv)
if not key in self.entries[self.requested_entry_index].html_tags.keys():
self.entries[self.requested_entry_index].html_tags[key] = merge(self.entries[self.requested_entry_index].tags, argv)
entry = self.entries[self.requested_entry_index]
if not key in entry.html_tags.keys():
entry.html_tags[key] = merge(entry.tags, argv)
return self.entries[self.requested_entry_index].html_tags[key]
return entry.html_tags[key]
def for_entry_metadata(self, argv):
if len(argv) != 2:
......@@ -688,7 +726,7 @@ class DataStore:
entry = self.entries[self.requested_entry_index]
key = ''.join(argv)
try:
l = getattr(entry, argv[0]).split(',')
l = getattr(entry, argv[0].strip()).split(',')
except:
raise GenericMessage(messages.entry_has_no_metadata_like.format(argv[0]))
......@@ -711,17 +749,19 @@ class DataStore:
""" TODO in 2.x.x: Access {count} and {weight} from LeavesForEntrycategories by taking benefit of preprocessing. """
def leaves_for_entry_categories(self, argv):
key = ''.join(argv)
if not key in self.entries[self.requested_entry_index].html_categories_leaves.keys():
entry = self.entries[self.requested_entry_index]
if not key in entry.html_categories_leaves.keys():
if self.blog_configuration["disable_categories"]:
self.entries[self.requested_entry_index].html_categories_leaves[key] = ''
entry.html_categories_leaves[key] = ''
else:
self.entries[self.requested_entry_index].html_categories_leaves[key] = merge(self.entries[self.requested_entry_index].categories_leaves, argv)
entry.html_categories_leaves[key] = merge(entry.categories_leaves, argv)
return self.entries[self.requested_entry_index].html_categories_leaves[key]
return entry.html_categories_leaves[key]
def leaves_for_blog_categories(self, argv):
key = ''.join(argv)
if not key in self.html_categories_leaves.keys():
if self.blog_configuration["disable_categories"]:
self.html_categories_leaves[key] = ''
......
......@@ -87,11 +87,11 @@ class Entry:
for key in metadata.keys():
if not key in ["authors", "tags", "categories", "title"]:
if metadata[key] != None:
setattr(self, key, metadata[key])
elif key == "https://schema.org" and metadata[key] != None:
self.schemadotorg = metadata[key]
if key == "https://schema.org":
self.schemadotorg = metadata[key]
else:
setattr(self, key, metadata[key])
else:
notify(messages.invalid_or_missing_metadata.format(key, filename), color="YELLOW")
setattr(self, key, '')
......
......@@ -113,4 +113,5 @@ class Messages:
undefined_variable = "{0} is undefined in {1}."
too_much_call_of_content = "There is too much call of .:GetEntryContent:. and/or .:GetEntryPreview in {0}"
entry_has_no_metadata_like = "Entry has no metadata identified by {0}."
invalid_range = "Invalid range {0}:{1}."
......@@ -111,3 +111,4 @@ class Messages:
undefined_variable = "{0} n'est pas défini dans \"{1}\"."
too_much_call_of_content = "Il y a trop d'appels de .:GetEntryContent:. et/ou de .:GetEntryPreview:. dans {0}"
entry_has_no_metadata_like = "La publication ne possède pas la métadonnée identifié par {0}."
invalid_range = "Plage de nombres invalide {0}:{1}."
......@@ -103,6 +103,9 @@ def set_style(argv):
def include_file(argv):
try:
filename = argv[0]
if argv[0] == '':
raise GenericMessage(messages.wrong_pattern_argument.format("path", argv[0], "include_file"))
include_string = open("includes/"+filename, 'r').read()
except IndexError:
......
......@@ -37,12 +37,14 @@ class PatternsMap():
"GetEntryDateURL" : datastore.get_entry_date_url,
"GetEntryURL" : datastore.get_entry_url,
"ForEntryAuthors" : datastore.for_entry_authors,
"ForEntryRange": datastore.for_entry_range,
"ForEntryTags" : datastore.for_entry_tags,
# Extra metadata getter
"LeavesForEntryCategories" : datastore.leaves_for_entry_categories,
"TreeForEntryCategories" : datastore.tree_for_entry_categories,
"ForEntryMetadata" : datastore.for_entry_metadata,
"ForEntryRange" : datastore.for_entry_range,
"GetEntryMetadata" : datastore.get_entry_metadata,
"GetEntryMetadataIfExists" : datastore.get_entry_metadata_if_exists
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment