From 64e2d7ea55347468687785c005cae7d7fb974dcb Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 29 Dec 2020 16:19:27 +0000 Subject: [PATCH] fix: author filter & visual updates --- src/.vuepress/config.js | 1 + .../theme/components/RSSSubscription.vue | 4 +- .../theme/components/blog/ActiveTags.vue | 48 +++++++++++++------ .../theme/components/blog/NewslinkCard.vue | 2 +- .../theme/components/blog/PostAuthor.vue | 26 ++++++---- .../theme/components/blog/PostHero.vue | 7 ++- .../theme/components/blog/PostMeta.vue | 23 ++++++++- .../theme/components/blog/PostTag.vue | 6 +-- .../theme/components/blog/RegularCard.vue | 5 +- .../blog/SearchCategoriesAndTags.vue | 6 ++- src/.vuepress/theme/layouts/Blog.vue | 32 ++++++++----- src/.vuepress/theme/store/appState.js | 10 ++++ src/.vuepress/theme/svg-icon/rss.svg | 2 +- src/.vuepress/theme/svg-icon/twitter-icon.svg | 2 +- src/.vuepress/theme/svg-icon/youtube-icon.svg | 2 +- src/.vuepress/theme/tailwind.config.js | 3 ++ src/.vuepress/theme/util/blogUtils.js | 17 +++++-- 17 files changed, 145 insertions(+), 51 deletions(-) diff --git a/src/.vuepress/config.js b/src/.vuepress/config.js index caa9a383..b5d7d90b 100644 --- a/src/.vuepress/config.js +++ b/src/.vuepress/config.js @@ -121,6 +121,7 @@ module.exports = { feeds: { rss2: { enable: true, + file_name: 'index.xml', }, atom1: { enable: false, diff --git a/src/.vuepress/theme/components/RSSSubscription.vue b/src/.vuepress/theme/components/RSSSubscription.vue index d451c8ed..0fc11eaf 100644 --- a/src/.vuepress/theme/components/RSSSubscription.vue +++ b/src/.vuepress/theme/components/RSSSubscription.vue @@ -9,7 +9,7 @@ rel="noopener noreferrer" > @@ -20,7 +20,7 @@ rel="noopener noreferrer" > diff --git a/src/.vuepress/theme/components/blog/ActiveTags.vue b/src/.vuepress/theme/components/blog/ActiveTags.vue index 391ccc58..46ac4a9a 100644 --- a/src/.vuepress/theme/components/blog/ActiveTags.vue +++ b/src/.vuepress/theme/components/blog/ActiveTags.vue @@ -3,36 +3,39 @@ v-if=" activeTags.length || searchedText.length || - resolvedActiveCategory !== 'all types' + resolvedActiveCategory !== 'all types' || + activeAuthor " - class="border border-opacity-10 flex items-center rounded px-1 py-2" + class="border-2 border-plBlack border-opacity-10 flex items-center rounded px-1 py-2" > Displaying {{ numberOfPosts }} result{{ numberOfPosts > 1 ? 's' : '' }}{{ numberOfPosts }} result{{ numberOfPosts !== 1 ? 's' : '' }} (newest first) of {{ resolvedActiveCategory }} - - for - "{{ text }}" - - + by {{ activeAuthor }} + for {{ resolvedSearchedText }} with tag{{ activeTags.length > 1 ? 's' : '' }}: -
    +
    +
    + ✕ +
    @@ -48,10 +51,18 @@ export default { }, }, computed: { - ...mapState('appState', ['activeCategory', 'activeTags', 'searchedText']), + ...mapState('appState', [ + 'activeCategory', + 'activeTags', + 'searchedText', + 'activeAuthor', + ]), resolvedActiveCategory() { return this.activeCategory ? `type "${this.activeCategory}"` : 'all types' }, + resolvedSearchedText() { + return `"${this.searchedText.join(' ')}"` + }, }, methods: { tagClick(tagToRemove) { @@ -59,6 +70,15 @@ export default { this.$store.commit('appState/setActiveTags', newTags) }, + handleClear() { + this.$store.commit('appState/clearFilters') + }, }, } + + diff --git a/src/.vuepress/theme/components/blog/NewslinkCard.vue b/src/.vuepress/theme/components/blog/NewslinkCard.vue index 7a41d143..3fade7e0 100644 --- a/src/.vuepress/theme/components/blog/NewslinkCard.vue +++ b/src/.vuepress/theme/components/blog/NewslinkCard.vue @@ -16,7 +16,7 @@
    - - {{ name }} + {{ name }}
    diff --git a/src/.vuepress/theme/components/blog/PostHero.vue b/src/.vuepress/theme/components/blog/PostHero.vue index 7273c062..2d26fb09 100644 --- a/src/.vuepress/theme/components/blog/PostHero.vue +++ b/src/.vuepress/theme/components/blog/PostHero.vue @@ -6,7 +6,12 @@

    {{ title }}

    - + + +
    -
      - +
        +
      • +
        {{ category }}
        +
      • +
    @@ -41,6 +51,10 @@ export default { type: String, default: null, }, + category: { + type: String, + default: null, + }, }, computed: { resolvedDate() { @@ -57,5 +71,10 @@ export default { .filter((tag) => tag) }, }, + methods: { + handleCatClick() { + this.$store.commit('appState/setActiveCategory', this.category) + }, + }, } diff --git a/src/.vuepress/theme/components/blog/PostTag.vue b/src/.vuepress/theme/components/blog/PostTag.vue index 93757810..157c1307 100644 --- a/src/.vuepress/theme/components/blog/PostTag.vue +++ b/src/.vuepress/theme/components/blog/PostTag.vue @@ -3,11 +3,9 @@ class="post-tag p-1 mr-1 bg-white text-blueGreen hover:underline rounded cursor-pointer" > - {{ tag }} + #{{ tag }} -
    - {{ tag }} -
    +
    #{{ tag }}
    diff --git a/src/.vuepress/theme/components/blog/RegularCard.vue b/src/.vuepress/theme/components/blog/RegularCard.vue index 836bd69b..b09c4e6d 100644 --- a/src/.vuepress/theme/components/blog/RegularCard.vue +++ b/src/.vuepress/theme/components/blog/RegularCard.vue @@ -27,12 +27,15 @@
    -

    +

    {{ title }}