Merge pull request #481 from liangliangyy/dev

修改样式 && update mapping
且听风吟 5 years ago committed by GitHub
commit 22bc09d209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,4 +34,4 @@ jobs:
linux/arm/v7
linux/arm/v6
linux/386
tags: liangliangyy/djangoblog:latest
tags: ${{ secrets.DOCKERHUB_USERNAME }}/djangoblog:latest

@ -14,7 +14,7 @@ import elasticsearch.client
from elasticsearch_dsl.connections import connections
import time
from blog.models import Article
from elasticsearch_dsl import Document, InnerDoc, Date, Integer, Long, Text, Object, GeoPoint
from elasticsearch_dsl import Document, InnerDoc, Date, Integer, Long, Text, Object, GeoPoint, Keyword
from django.conf import settings
@ -45,18 +45,18 @@ if ELASTICSEARCH_ENABLED:
class GeoIp(InnerDoc):
continent_name = Text()
country_iso_code = Text()
country_name = Text()
continent_name = Keyword()
country_iso_code = Keyword()
country_name = Keyword()
location = GeoPoint()
class ElapsedTimeDocument(Document):
url = Text()
url = Keyword()
time_taken = Long()
log_datetime = Date()
useragent = Text(analyzer='ik_max_word', search_analyzer='ik_smart')
ip = Text()
ip = Keyword()
geoip = Object(GeoIp, required=False)
class Index:

@ -2438,3 +2438,18 @@ li #reply-title {
font-size: small;
}
.breadcrumb {
margin-bottom: 20px;
list-style: none;
border-radius: 4px;
}
.breadcrumb > li {
display: inline-block;
}
.breadcrumb > li + li:before {
color: #ccc;
content: "/\00a0";
}
.breadcrumb > .active {
color: #777;
}

@ -102,7 +102,8 @@ def load_breadcrumb(article):
return {
'names': names,
'title': article.title
'title': article.title,
'count': len(names) + 1
}

@ -1,14 +1,19 @@
<div class="breadcrumb">
{% for name,url in names %}
<div itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<ul itemscope itemtype="https://schema.org/BreadcrumbList" class="breadcrumb">
<a href="{{ url }}" itemprop="url">
{% for name,url in names %}
<li itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem">
<a href="{{ url }}" itemprop="item" >
<span itemprop="name">{{ name }}</span></a>
<meta itemprop="position" content="{{ forloop.counter }}"/>
<span itemprop="title"> {{ name }}</span>
</li>
{% endfor %}
<li class="active" itemprop="itemListElement" itemscope
itemtype="https://schema.org/ListItem">
<span itemprop="name">{{ title }}</span>
<meta itemprop="position" content="{{ count }}"/>
</li>
</a>&nbsp;&rsaquo;
</ul>
</div>
{% endfor %}
{{ title }}
</div>
Loading…
Cancel
Save