Blog on frontpage
This commit is contained in:
parent
f2d9df8b61
commit
f75c43055f
@ -741,7 +741,7 @@ def project_update_nodes_list(node, project_id=None, list_name='latest'):
|
||||
node_list_name = 'nodes_' + list_name
|
||||
project[node_list_name] = []
|
||||
nodes_list = project[node_list_name]
|
||||
elif len(nodes_list) > 10:
|
||||
elif len(nodes_list) > 15:
|
||||
nodes_list.pop(0)
|
||||
|
||||
if node._id in nodes_list:
|
||||
|
@ -399,6 +399,112 @@
|
||||
&.clear:hover
|
||||
color: $color-danger
|
||||
|
||||
section#blog-stream
|
||||
position: relative
|
||||
|
||||
.feed
|
||||
position: absolute
|
||||
top: 10px
|
||||
right: 10px
|
||||
font-size: 1.4em
|
||||
color: lighten($color-text-dark-hint, 10%)
|
||||
|
||||
&:hover
|
||||
color: $color-primary
|
||||
|
||||
ul#blog-stream__list
|
||||
background-color: $color-background-light
|
||||
margin: 0
|
||||
padding: 0
|
||||
list-style: none
|
||||
border:
|
||||
top: thin solid $color-background
|
||||
bottom-left-radius: 3px
|
||||
bottom-right-radius: 3px
|
||||
|
||||
.blog-stream__list-item
|
||||
display: flex
|
||||
padding: 7px 15px
|
||||
border-top: thin solid $color-background
|
||||
|
||||
&:first-child
|
||||
border-top: none
|
||||
&:last-child
|
||||
border:
|
||||
bottom-left-radius: 3px
|
||||
bottom-right-radius: 3px
|
||||
|
||||
&.more
|
||||
font-size: .9em
|
||||
a
|
||||
width: 100%
|
||||
text-align: right
|
||||
color: $color-text-dark-secondary
|
||||
&:hover
|
||||
color: $color-primary
|
||||
|
||||
.blog-stream__list-thumbnail
|
||||
display: block
|
||||
position: relative
|
||||
width: 50px
|
||||
min-width: 50px
|
||||
height: 50px
|
||||
min-height: 50px
|
||||
margin-right: 15px
|
||||
background-color: $node-type-post
|
||||
border-radius: 50%
|
||||
overflow: hidden
|
||||
|
||||
img
|
||||
width: 100%
|
||||
|
||||
i
|
||||
+position-center-translate
|
||||
font-size: 1.6em
|
||||
color: $color-text-light-primary
|
||||
|
||||
.blog-stream__list-details
|
||||
.title
|
||||
display: block
|
||||
color: $color-text-dark-primary
|
||||
&:hover
|
||||
color: $color-primary
|
||||
|
||||
ul.meta
|
||||
+list-meta
|
||||
padding-top: 5px
|
||||
font-size: .9em
|
||||
color: $color-text-dark-secondary
|
||||
|
||||
li
|
||||
padding-left: 10px
|
||||
&:before
|
||||
left: -5px
|
||||
|
||||
&.featured
|
||||
flex-direction: column
|
||||
padding: 0
|
||||
|
||||
a.title
|
||||
font-size: 1.1em
|
||||
padding: 10px 0 0 15px
|
||||
display: block
|
||||
color: $color-text-dark-primary
|
||||
&:hover
|
||||
color: $color-primary
|
||||
|
||||
a.blog-stream__thumbnail
|
||||
display: block
|
||||
position: relative
|
||||
img
|
||||
width: 100%
|
||||
|
||||
ul.meta
|
||||
+list-meta
|
||||
padding: 5px 15px 10px 15px
|
||||
font-size: .9em
|
||||
|
||||
|
||||
|
||||
section.announcement
|
||||
border-bottom: thin solid $color-background
|
||||
|
@ -39,10 +39,6 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
|
||||
data-filter='file',
|
||||
title="List files")
|
||||
i.pi-file-archive
|
||||
li.filter.active(
|
||||
data-filter='post',
|
||||
title="List blog posts")
|
||||
i.pi-newspaper
|
||||
li.filter(
|
||||
data-filter='comment',
|
||||
title="List comments")
|
||||
@ -133,6 +129,64 @@ meta(name="twitter:image", content="{% if main_project.picture_header %}{{ main_
|
||||
href="https://cloud.blender.org/p/agent-327/")
|
||||
| Learn More
|
||||
|
||||
section#blog-stream
|
||||
a.feed(
|
||||
href="{{ url_for('main.feeds_blogs') }}",
|
||||
title="Blender Cloud & Projects Blog Feed",
|
||||
data-toggle="tooltip",
|
||||
data-placement="left")
|
||||
i.pi-rss
|
||||
|
||||
h3
|
||||
a(href="{{ url_for('main.main_blog') }}") Blog
|
||||
|
||||
ul#blog-stream__list
|
||||
| {% if latest_posts %}
|
||||
| {% for n in latest_posts %}
|
||||
| {% if n.picture and loop.first %}
|
||||
li.blog-stream__list-item.featured
|
||||
a.blog-stream__thumbnail(
|
||||
href="{{ url_for_node(node=n) }}")
|
||||
img(src="{{ n.picture.thumbnail('l', api=api) }}")
|
||||
a.title(href="{{ url_for_node(node=n) }}")
|
||||
| {{ n.name }}
|
||||
|
||||
ul.meta
|
||||
li.when
|
||||
a(href="{{ url_for_node(node=n) }}",
|
||||
title="Updated {{ n._updated | pretty_date }}")
|
||||
| {{ n._created | pretty_date }}
|
||||
li.where-project
|
||||
a.project(href="{{ url_for('projects.view', project_url=n.project.url) }}") {{ n.project.name }}
|
||||
| {% else %}
|
||||
li.blog-stream__list-item
|
||||
a.blog-stream__list-thumbnail(href="{{ url_for_node(node=n) }}")
|
||||
| {% if n.picture %}
|
||||
img.image(src="{{ n.picture.thumbnail('s', api=api) }}")
|
||||
| {% else %}
|
||||
i.pi-newspaper
|
||||
| {% endif %}
|
||||
.blog-stream__list-details
|
||||
a.title(href="{{ url_for_node(node=n) }}") {{ n.name }}
|
||||
ul.meta
|
||||
li.when
|
||||
a(href="{{ url_for_node(node=n) }}",
|
||||
title="Updated {{ n._updated | pretty_date }}")
|
||||
| {{ n._created | pretty_date }}
|
||||
li.where-project
|
||||
a.project(href="{{ url_for('projects.view', project_url=n.project.url) }}") {{ n.project.name }}
|
||||
| {% endif %}
|
||||
| {% endfor %}
|
||||
| {% else %}
|
||||
li.blog-stream__list-item
|
||||
.blog-stream__list-details
|
||||
ul.meta
|
||||
li.when No updates yet
|
||||
| {% endif %}
|
||||
li.blog-stream__list-item.more
|
||||
a(href="{{ url_for('main.main_blog') }}") See All Blog Posts
|
||||
|
||||
|
||||
section#random-asset
|
||||
h3
|
||||
a(href="/search") Explore the Cloud
|
||||
|
@ -37,8 +37,8 @@ html(lang="en")
|
||||
|
||||
loadCSS( "//fonts.googleapis.com/css?family=Roboto:300,400" );
|
||||
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/markdown.min.js', v=241120162) }}")
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/tutti.min.js', v=241120162) }}")
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/markdown.min.js', v=251120161) }}")
|
||||
script(src="{{ url_for('static_pillar', filename='assets/js/tutti.min.js', v=251120161) }}")
|
||||
|
||||
link(href="{{ url_for('static', filename='assets/img/favicon.png') }}", rel="shortcut icon")
|
||||
link(href="{{ url_for('static', filename='assets/img/apple-touch-icon-precomposed.png') }}", rel="icon apple-touch-icon-precomposed", sizes="192x192")
|
||||
@ -48,12 +48,12 @@ html(lang="en")
|
||||
| {% block head %}{% endblock %}
|
||||
|
||||
| {% block css %}
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css', v=241120162) }}", rel="stylesheet")
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/base.css', v=241120162) }}", rel="stylesheet")
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css', v=251120161) }}", rel="stylesheet")
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/base.css', v=251120161) }}", rel="stylesheet")
|
||||
| {% if title == 'blog' %}
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=241120162) }}", rel="stylesheet")
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=251120161) }}", rel="stylesheet")
|
||||
| {% else %}
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/main.css', v=241120162) }}", rel="stylesheet")
|
||||
link(href="{{ url_for('static_pillar', filename='assets/css/main.css', v=251120161) }}", rel="stylesheet")
|
||||
| {% endif %}
|
||||
| {% endblock %}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user