Giter Site home page Giter Site logo

hexo-pwa's People

Contributors

idindrakusuma avatar jodumont avatar marcofranssen avatar pengxing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

hexo-pwa's Issues

how to exclude ressource/script ?

Hi;

I know it's probably more a question for sw team but, just in case you know how and/or you already have a trick for me

Do you know how I could exclude ressource/script ?
because I have a quota exceeded error when I use your plugins with disqus

so I would like to understand how to exlude disqus js

I also found this

After hexo upgrading 4.2.0, hexo-pwa fails to generate html.

The root cause is that

@mystic-cg

Locals.cache should only be considered as an Internal private API. After c6e6e6b#diff-8706ed85bcc456bc4bd99698f3cb949dR7 the Locals.cache is now Locals.cache.cache.

According to Hexo API's documents, there is already a method called Locals.toObject(). The developer should always using public API for consistency. Please open an issue at hexo-pwa and asking them for using Locals.toObject() instead of Locals.cache.

Related issue: tea3/hexo-related-popular-posts#23

After upgrading 4.2.0, it caused that generating html with hexo-pwa is failed #4044
hexojs/hexo#4044

【Bug Report】FATAL YAMLException: unknown tag !<tag:yaml.org,2002:js/regexp> (153:44)

Use hexo clean found a bug:

$ hexo clean
FATAL YAMLException: unknown tag !<tag:yaml.org,2002:js/regexp> (153:44)

 150 |  ...
 151 |  ... TimeoutSeconds: 5
 152 |  ...
 153 |  ... rn: !!js/regexp /hm.baidu.com/
------------------------------------------^
 154 |  ... egy: networkOnly
 155 |  ... rn: !!js/regexp /.*\.(js|css|jpg|jpeg|png|gif)$/
    at generateError (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:183:10)
    at throwError (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:187:9)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1521:7)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readBlockSequence (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1008:5)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1440:12)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readBlockMapping (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1164:11)
    at composeNode (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1441:12)
    at readDocument (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1625:3)
    at loadDocuments (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1688:5)
    at Object.load (D:\hexo\myblog\node_modules\js-yaml\lib\loader.js:1714:19)
    at Hexo.yamlHelper (D:\hexo\myblog\node_modules\hexo\lib\plugins\renderer\yaml.js:7:15)
    at Hexo.tryCatcher (D:\hexo\myblog\node_modules\bluebird\js\release\util.js:16:23)
    at Hexo.<anonymous> (D:\hexo\myblog\node_modules\bluebird\js\release\method.js:15:34)
    at D:\hexo\myblog\node_modules\hexo\lib\hexo\render.js:81:22
    at tryCatcher (D:\hexo\myblog\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (D:\hexo\myblog\node_modules\bluebird\js\release\promise.js:547:31) {
  reason: 'unknown tag !<tag:yaml.org,2002:js/regexp>',
  mark: {
    name: null,
    buffer: '# Hexo Configuration\n' +
      '## Docs: https://hexo.io/docs/configuration.html\n' +
      '## Source: https://github.com/hexojs/hexo/\n' +
      '\n' +
      '# Site\n' +
      "title: QuestionMark001's Blog\n" +
      "subtitle: 'Be thankful and be gentle.'\n" +
      "description: 'QuestionMark001的个人博客'\n" +
      'keywords: 个人博客,Linux,GitHub,C,python,Go,C#,C++,Java,HTML5,NodeJs,Hexo,VueJs\n' +
      'author: QuestionMark001-向阳菌\n' +
      'language: zh-CN\n' +
      "timezone: ''\n" +
      '\n' +
      '# URL\n' +
      "## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'\n" +
      'url: https://questionmark001.github.io\n' +
      'permalink: :year/:month/:day/:title/\n' +
      'permalink_defaults:\n' +
      'pretty_urls:\n' +
      "  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks\n" +
      "  trailing_html: true # Set to false to remove trailing '.html' from permalinks\n" +
      '\n' +
      '# Directory\n' +
      'source_dir: source\n' +
      'public_dir: public\n' +
      'tag_dir: tags\n' +
      'archive_dir: archives\n' +
      'category_dir: categories\n' +
      'code_dir: downloads/code\n' +
      'i18n_dir: :lang\n' +
      'skip_render:\n' +
      '  - "wechat/*"\n' +
      '\n' +
      '# Writing\n' +
      'new_post_name: :title.md # File name of new posts\n' +
      'default_layout: post\n' +
      'titlecase: false # Transform title into titlecase\n' +
      'external_link:\n' +
      '  enable: true # Open external links in new tab\n' +
      '  field: site # Apply to the whole site\n' +
      "  exclude: ''\n" +
      'filename_case: 0\n' +
      'render_drafts: false\n' +
      'post_asset_folder: false\n' +
      'relative_link: false\n' +
      'future: true\n' +
      'highlight:\n' +
      '  enable: true\n' +
      '  line_number: true\n' +
      '  auto_detect: false\n' +
      "  tab_replace: ''\n" +
      '  wrap: true\n' +
      '  hljs: false\n' +
      'prismjs:\n' +
      '  enable: false\n' +
      '  preprocess: true\n' +
      '  line_number: true\n' +
      "  tab_replace: ''\n" +
      '\n' +
      '# Home page setting\n' +
      "# path: Root path for your blogs index page. (default = '')\n" +
      '# per_page: Posts displayed per page. (0 = disable pagination)\n' +
      '# order_by: Posts order. (Order by date descending by default)\n' +
      'index_generator:\n' +
      "  path: ''\n" +
      '  per_page: 10\n' +
      '  order_by: -date\n' +
      '\n' +
      '# Category & Tag\n' +
      'default_category: uncategorized\n' +
      'category_map:\n' +
      'tag_map:\n' +
      '\n' +
      '# Metadata elements\n' +
      '## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta\n' +
      'meta_generator: true\n' +
      '\n' +
      '# Date / Time format\n' +
      '## Hexo uses Moment.js to parse and display date\n' +
      '## You can customize the date format as defined in\n' +
      '## http://momentjs.com/docs/#/displaying/format/\n' +
      'date_format: YYYY-MM-DD\n' +
      'time_format: HH:mm:ss\n' +
      "## updated_option supports 'mtime', 'date', 'empty'\n" +
      "updated_option: 'mtime'\n" +
      '\n' +
      '# Pagination\n' +
      '## Set per_page to 0 to disable pagination\n' +
      'per_page: 10\n' +
      'pagination_dir: page\n' +
      '\n' +
      '# Include / Exclude file(s)\n' +
      "## include:/exclude: options only apply to the 'source/' folder\n" +
      'include:\n' +
      'exclude:\n' +
      'ignore:\n' +
      '\n' +
      '# Extensions\n' +
      '## Plugins: https://hexo.io/plugins/\n' +
      '## Themes: https://hexo.io/themes/\n' +
      'theme: stun\n' +
      '\n' +
      '# Deployment\n' +
      '## Docs: https://hexo.io/docs/one-command-deployment\n' +
      'deploy:\n' +
      "  type: 'git'\n" +
      '  repository: [email protected]:QuestionMark001/QuestionMark001.github.io.git\n' +
      '  branch: main\n' +
      '\n' +
      '# Feed\n' +
      'feed:\n' +
      '  enable: true\n' +
      '  type: atom\n' +
      '  path: atom.xml\n' +
      '  limit: 20\n' +
      '  hub:\n' +
      '  content:\n' +
      '  content_limit: 140\n' +
      "  content_limit_delim: ' '\n" +
      '  order_by: -date\n' +
      '  icon: icon.png\n' +
      '  autodiscovery: true\n' +
      '  template:\n' +
      '\n' +
      '# Pwa\n' +
      'pwa:\n' +
      '  manifest:\n' +
      '    path: /manifest.json\n' +
      '    body:\n' +
      `      "name": "QuestionMark001's Blog"\n` +
      '      "short_name": "QuestionMark001"\n' +
      '      "theme_color": "rgba(203,7,83,0.86)"\n' +
      '      "background_color": "#ffffff"\n' +
      '      "display": "standalone"\n' +
      '      "Scope": "/"\n' +
      '      "start_url": "/"\n' +
      '      icons:\n' +
      '        - src: /android-chrome-192x192.png\n' +
      '          sizes: 192x192\n' +
      '          type: image/png\n' +
      '        - src: /android-chrome-512x512.png\n' +
      '          sizes: 512x512\n' +
      '          type: image/png\n' +
      '  serviceWorker:\n' +
      '    path: /sw.js\n' +
      '    preload:\n' +
      '      urls:\n' +
      '        - /\n' +
      '      posts: 5\n' +
      '    opts:\n' +
      '      networkTimeoutSeconds: 5\n' +
      '    routes:\n' +
      '      - pattern: !!js/regexp /hm.baidu.com/\n' +
      '        strategy: networkOnly\n' +
      '      - pattern: !!js/regexp /.*\\.(js|css|jpg|jpeg|png|gif)$/\n' +
      '        strategy: cacheFirst\n' +
      '      - pattern: !!js/regexp /\\//\n' +
      '        strategy: networkFirst\n' +
      '  priority: 5\n',
    position: 3579,
    line: 152,
    column: 43,
    snippet: ' 150 |  ... \n' +
      ' 151 |  ... TimeoutSeconds: 5\n' +
      ' 152 |  ... \n' +
      ' 153 |  ... rn: !!js/regexp /hm.baidu.com/\n' +
      '------------------------------------------^\n' +
      ' 154 |  ... egy: networkOnly\n' +
      ' 155 |  ... rn: !!js/regexp /.*\\.(js|css|jpg|jpeg|png|gif)$/'
  }
}

chrome-extension Error

He works great, but the only problem is that the console has been outputting such errors, do you know why?

/sw.js?t=1515437173661:14 Uncaught (in promise) TypeError: Request scheme 'chrome-extension' is unsupported at /sw.js?t=1515437173661:14 at <anonymous>

如何设置?

我设置了manifest.json

{
  "name": "Jerryc",
  "short_name": "JerryC",
  "theme_color": "#3f51b5",
  "background_color": "#3f51b5",
  "display": "fullscreen",
  "Scope": "/",
  "start_url": "/",
  "icons": [
    {
      "src": "img/icons/icon-72x72.png",
      "sizes": "72x72",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-96x96.png",
      "sizes": "96x96",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-128x128.png",
      "sizes": "128x128",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-144x144.png",
      "sizes": "144x144",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-152x152.png",
      "sizes": "152x152",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-192x192.png",
      "sizes": "192x192",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-384x384.png",
      "sizes": "384x384",
      "type": "image/png"
    },
    {
      "src": "img/icons/icon-512x512.png",
      "sizes": "512x512",
      "type": "image/png"
    }
  ],
  "splash_pages": null
}

_CONFIG 也设置了

pwa:
  manifest:
    path: /manifest.json
    body:
      # name: Jerryc
      # short_name: Jerryc 
      # icons:
      #   - src: img/icons/icon-192x192.png
      #     sizes: 192x192
      #     type: image/png
  serviceWorker:
    path: /sw.js
    preload:
      urls:
        - /
      posts: 5
    opts:
      networkTimeoutSeconds: 5
    routes:
      - pattern: !!js/regexp /hm.baidu.com/
        strategy: networkOnly
      - pattern: !!js/regexp /.*\.(js|css|jpg|jpeg|png|gif)$/
        strategy: cacheFirst
      - pattern: !!js/regexp /\//
        strategy: networkFirst
  priority: 5

但是不起作用。
我是不是漏了什么步骤
Jerryc.me

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.