Skip to content

Instantly share code, notes, and snippets.

@varyen
varyen / nuxt.config.js
Created October 10, 2018 19:18
Жесткая инвалидация кеша JS-файлов, генерируемых nuxtом
const git = require('git-last-commit');
let latestCommit;
git.getLastCommit(function(err, commit) {
// read commit object properties
latestCommit = commit;
});
let nuxtConfig = {
// .....................
@varyen
varyen / vue-noindex.js
Last active March 27, 2019 19:14
Vue component: prevent childs from indexing by crawlers
export default {
name: 'NoIndex',
functional: true,
props: {
tag: {
type: String,
default: 'div',
},
#конвертим дату!
local_date: //span[has-class("post__time_published")]
#@replace("\n", "", "s"): $local_date/text()
@replace("^[ \n]+", "", "s"): $local_date/text()
@debug
#полная дата
@replace("^(.+) (\\w+)( \\d+)? в (\\S+).+", "$1 $2$3, $4", "s"): $local_date/text()