博客 rss 如何使用_如何使用RSS从您的GatsbyJS博客自动交叉发布
博客 rss 如何使用
With the recent exodus from Medium many developers are now creating their own GatsbyJS Blogs and then cross-posting to Medium or publications like freecodecamp.org and dev.to.
随着Medium最近的离职,许多开发人员现在正在创建自己的GatsbyJS Blog,然后交叉发布到Medium或诸如freecodecamp.org和dev.to之类的出版物。
Cross-posting is time consuming, but necessary to drive traffic to your personal site. Let's look at how we can automate this by adding an RSS feed to your personal GatsbyJS blog.
交叉发布非常耗时,但是对于将流量吸引到您的个人站点是必需的。 让我们看看如何通过在您的个人GatsbyJS博客中添加RSS提要来实现此目的的自动化。
将规范URL添加到您的博客 (Add Canonical URL's to Your Blog)
What is a canonical url?
什么是规范网址?
A canonical url tells search engines which page is the primary or authorative page when duplicate content is found (ie. cross-posting).
当发现重复的内容(即交叉发布)时,规范的网址会告诉搜索引擎哪个页面是主要页面或权威页面。
Let's install gatsby-plugin-canonical-urls
让我们安装gatsby-plugin-canonical-urls
Quick tip: npm i
is an alias for npm install --save
快速提示: npm i
是npm install --save
的别名
npm i gatsby-plugin-canonical-urls
Note: If you are using gatsby-plugin-react-helmet
install this plugin instead: gatsby-plugin-react-helmet-canonical-urls*
注意:如果您使用的是gatsby-plugin-react-helmet
请安装此插件: gatsby-plugin-react-helmet-canonical-urls *
npm i gatsby-plugin-react-helmet-canonical-urls
Add plugin configuration to /gatsby-config.js
将插件配置添加到/gatsby-config.js
// In your gatsby-config.js
plugins: [{resolve: `gatsby-plugin-canonical-urls`,// or// resolve: `gatsby-plugin-react-helmet-canonical-urls`options: {// Change `siteUrl` to your domain siteUrl: `https://tueri.io`// Query string parameters are inclued by default.// Set `stripQueryString: true` if you don't want `/blog` // and `/blog?tag=foobar` to be indexed separatelystripQueryString: true}}
]
With this configuration, the plugin will add a <link rel="canonical" ... />
to the head of every page e.g.
使用此配置,插件将在每个页面的开头添加<link rel="canonical" ... />
,例如
<link rel="canonical" href="https://tueri.io/2019-04-04-how-to-securely-deploy-to-kubernetes-from-bitbucket-pipelines/" />
安装RSS Feed生成器 (Install an RSS Feed Generator)
We'll use gatsby-plugin-feed to generate an rss feed from our blog posts.
我们将使用gatsby-plugin- feed从我们的博客帖子中生成一个rss feed。
npm i gatsby-plugin-feed
Add plugin configuration to /gatsby-config.js
将插件配置添加到/gatsby-config.js
// In your gatsby-config.js
plugins: [{resolve: `gatsby-plugin-feed`,options: {query: `{site {siteMetadata {titledescriptionsiteUrlsite_url: siteUrl}}}`,feeds: [{serialize: ({ query: { site, allMarkdownRemark } }) => {return allMarkdownRemark.edges.map(edge => {return Object.assign({}, edge.node.frontmatter, {description: edge.node.excerpt,date: edge.node.frontmatter.date,url: site.siteMetadata.siteUrl + edge.node.fields.slug,guid: site.siteMetadata.siteUrl + edge.node.fields.slug,custom_elements: [{ "content:encoded": edge.node.html }],})})},query: `{allMarkdownRemark(sort: { order: DESC, fields: [frontmatter___date] },) {edges {node {excerpthtmlfields { slug }frontmatter {titledate}}}}}`,output: "/rss.xml",title: "Your Site's RSS Feed",// optional configuration to insert feed reference in pages:// if `string` is used, it will be used to create RegExp and then test if pathname// of current page satisfied this regular expression;// if not provided or `undefined`, all pages will have feed reference insertedmatch: "^/blog/",},],}}
]
NOTE: This plugin will only generates the xml
file(s) when run in production
mode! To test your feed, run: gatsby build && gatsby serve
注意:此插件仅在production
模式下运行时才会生成xml
文件! 要测试您的供稿,请运行: gatsby build && gatsby serve
Here's what our feed looks like: Tueri.io's RSS Feed
这是我们的feed的样子: Tueri.io的RSS feed
For more information on configuring your feed check out the plugin docs.
有关配置Feed的更多信息,请查看插件文档 。
将dev.to连接到您的RSS feed (Connect dev.to to Your RSS Feed)
Log in to your dev.to account
登录到您的dev.to帐户
Go to: Settings > Publishing from RSS or https://dev.to/settings/publishing-from-rss
转到:设置>从RSS或https://dev.to/settings/publishing-from-rss发布
Add your "RSS Feed URL" e.g. https://tueri.io/rss.xml
添加您的“ RSS Feed URL”,例如https://tueri.io/rss.xml
- Check "Mark the RSS source as canonical URL by default选中“默认情况下将RSS源标记为规范URL
- Click "Update"点击“更新”
将媒介连接到您的RSS Feed (Connect Medium to Your RSS Feed)
The connection for Medium is not quite as straight-forward, but simple enough using Zapier.
Medium的连接不那么直接,但是使用Zapier足够简单。
Head on over to Zapier and create a free account.
前往Zapier并创建一个免费帐户。
“做个炸弹” ("Make a Zap")
- Choose "RSS" as your "Trigger App"选择“ RSS”作为“触发应用程序”
- Select "New Item in Feed"选择“ Feed中的新项目”
- Paste in your "Feed URL"粘贴到“ Feed URL”中
- Select a sample from your feed.从Feed中选择一个样本。
- Choose "Medium" as your "Action App"选择“中”作为“动作应用”
- Select "Create Story"选择“创建故事”
- Authorize your Medium account授权您的中型帐户
- Select your fields: make sure you select your Canonical URL选择您的字段:确保选择您的规范URL
- Send a test to Medium发送测试到中
- Finish and turn on your Zap完成并打开您的Zap
结论 (Conclusion)
Make sure Google gives you credit for your content by using Canonical URL's.
确保Google通过使用规范网址将内容归功于您。
I hope you found this helpful and that it saves you lots of time cross-posting your content!
希望对您有所帮助,这样可以节省您交叉发布内容的大量时间!
Originally published at Tueri.io
最初发表于Tueri.io
翻译自: https://www.freecodecamp.org/news/how-to-automatically-cross-post-from-your-gatsbyjs-blog-with-rss/
博客 rss 如何使用
相关文章:

大型技术网站的技术( 高并发、大数据、高可用、分布式....)(一)
面对高并发、大流量、高可用、海量数据、用户分布广泛、网络情况复杂这类网站系统我们如何应对??? 第一阶段 一台服务器不行就上多台服务器 1.应用程序与数据服务分离 将应用程序、数据库、文件等资源放在一台服务器上,面对海量…

BestCoder Round #65 B C D || HDU 5591 5592 5593
B 题意:ZYB在远足中,和同学们玩了一个“数字炸弹”游戏:由主持人心里想一个在[1,N][1,N]中的数字XX,然后玩家们轮流猜一个数字,如果一个玩家恰好猜中XX则算负,否则主持人将告诉全场的人当前的数和XX比是偏大还是偏小&a…

数组去重,ES6数组去重 new Set()
普通数组去重 var b [...new Set([1,2, 3, 4, 5, 5, 5, 5])]console.log(b); 输出结果: 包含对象的数组去重 var o {a:1}var b [...new Set([o, o, 3, 4, 5, 5, 5, 5])]console.log(b); 输出结果: 包含对象的数组去重有一个坑 var b [...new Set([{…

使用angular的好处_在项目中使用Angular的最大好处
使用angular的好处by Irina Sidorenko伊琳娜西多连科(Irina Sidorenko) 在项目中使用Angular的最大好处 (The top benefits of using Angular for your project) 在项目实施中使用Angular的11个理由及其好处 (11 reasons to use Angular and its benefits for your project im…

python之路——模块和包
一、模块 1、什么是模块? 常见的场景:一个模块就是一个包含了Python定义和声明的文件,文件名就是模块名字加上.py的后缀。 但其实import加载的模块分为四个通用类别: 1、使用Python编写的代码(.py文件) 2、…

夺命雷公狗---linux NO:3 centos_mini版的安装和备份
废话不多说,和前面的其实是差不多的,如下图所示: 安装其实是和桌面版的差不多的,但是经典版的不能自定义分区(如详细区,如home之类的)。。。 因为我们使用的是命令行方式的所以直接选英文&#…

快速学习 async await 的使用, Demo 解析
async 和 await 字面都很好理解,分别是异步和等待。 来两个简单的 demo, demo1 tt2(){return new Promise(rps>{setTimeout(() > {rps(true)}, 1500);})},async tt1(){var a await this.tt2();console.log(a)},/*** 生命周期函数--监听页面加载*…

小型工作室创业项目_为什么新开发人员应该在小型创业公司工作
小型工作室创业项目In my first year of working in the industry (6 months as an intern, 6 months as a full-time employee), I worked at startups that were less than 10 people large. I was one of the only 2 or 3 developers, and usually one of the first. Throug…

head first python菜鸟学习笔记(第六章)
1. Python提供字典,允许有效组织数据,将数据与名关联,从而实现快速查找,而不是以数字关联。 字典是内置数据结构,允许将数据与键而不是数字关联。这样可以使内存中的数据与实际数据的结构保持一致。?&#…

小程序聊天室开发,发送文字,表情,图片,音频,视频,即时通讯,快速部署,可定制开发
效果图: 微信小程序聊天功能模块,现在已经支持发送图片,文字,音频,视频,表情,在线即时聊天啦。 需要做的可以联系我微信。13977284413 上代码: <view class"bo">…

常用浏览器插件
modify headers :firefox的IP伪造插件 httpRequester:firefox的模拟http请求插件JSON-handle:chrome格式化json插件firebug:firefox查看http请求工具firepath:firefox中获取元素路径转载于:https://www.cnblogs.com/xx…

编码中统一更该变量的快捷键_更多项目想法,以提高您的编码技能
编码中统一更该变量的快捷键Two weeks ago I published an article containing 15 project ideas that you can build to level up your coding skills, and people were very excited about that resource.两周前,我发表了一篇文章,其中包含15个项目构想…
My97DatePicker日历控件日报、每周和每月的选择
My97DatePicker日历控件日报、每周和每月的选择 1、设计源代码 <% page language"java" import"java.util.*" pageEncoding"UTF-8"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><h…

DotNet Core Console 程序使用NLog
参考:https://github.com/NLog/NLog/wiki/Tutorial 步骤: 1. 使用Nuget安装NLog.Extensions.Logging Install-Package NLog.Extensions.Logging 2.编写代码(到这步运行代码,不报错,但是也不会有log输出,因为…

小程序判断用户在线状态
在页面的两个生命周期组件里面 onShow() {console.log(-----上线线)let info wx.getStorageSync(chat_item)DB.collection(friends).where({_id: info._id}).get().then(res > {console.log(-----, res)if (res.data[0].a wx.getStorageSync(userInfo)._openid) {console.…

react.js做小程序_如何使用React.js构建现代的聊天应用程序
react.js做小程序In this tutorial, I will guide you to build your own group chat application using React, React Router, and CometChat Pro. Yes, rather than roll out our own server, we will instead use CometChat Pro to handle the real-time sending and receiv…

RAP Mock.js语法规范
Mock.js 的语法规范包括两部分: 数据模板定义规范(Data Template Definition,DTD)数据占位符定义规范(Data Placeholder Definition,DPD)1.数据模板定义规范 DTD 数据模板中的每个属性由 3 部分…

NSDictionary、NSMutableDictionary基本使用
郝萌主倾心贡献,尊重作者的劳动成果。请勿转载。假设文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额任意,重在心意^_^ 我要捐赠: 点击捐赠Cocos2d-X源代码下载:点我传送游戏官方下载:htt…

h5轮播图及效果图
效果图: 代码: <!doctype html> <html><head><meta charset"utf-8"><title>jQuery响应式卡片轮播切换代码</title><link rel"stylesheet" type"text/css" href"css/style.c…

性能测试回归测试_自动网站性能回归测试
性能测试回归测试by Adam Henson亚当汉森(Adam Henson) 如何使用Foo自动执行网站性能回归测试 (How to automate website performance regression testing with Foo) 使用部署后步骤自动执行连续交付工作流程中的性能回归测试 (Using a post deploy step to automate performa…

【html】【13】特效篇--下拉导航
html代码: 1 <!DOCTYPE html>2 <html>3 <head>4 <meta http-equiv"Content-Type" content"text/html; charsetUTF-8">5 <title>Bootstrap导航条鼠标悬停下拉菜单</title>6 <li…

小程序获取用户所在城市完整代码
小程序目录结构 插入提示: 1. 申请开发者密钥(key): 申请密钥 2. 下载微信小程序JavaScriptSDK,下载地址 下载完成后放入utils文件夹下引用即可 3. 安全域名设置,在“设置” -> “开发设置”中设置req…

prolog_如何通过观看权力的游戏学习Prolog
prologby Rachel Wiles瑞秋威尔斯(Rachel Wiles) 如何通过观看权力的游戏学习Prolog (How to learn Prolog by watching Game of Thrones) 他们死了吗? 他们还活着吗? 她是他的姨妈吗? 不用把精力浪费在2011年,而可以使用Prolog节…

身份证号码对应地区-官方措辞:行政区划代码
身份证前6位代表着该身份证的籍贯在哪里,而官方的措辞则为:行政区划代码 如何找到最新的行政区划代码了? 通过:http://blog.sina.com.cn/s/blog_5a76dae20100tqv5.html 此人的博客得知,行政区划代码是国家统计局统计的…

Jquery_操作cookies
首先引入jquery.cookie.js jquery.cookie.js下地址:http://plugins.jquery.com/cookie/ 操作文档: https://github.com/carhartl/jquery-cookie#readme 创建cookies: $.cookie(name, value); 设置有效期: 设置七天过期 $.cookie(n…

rem转rpx工具
对样式进行格式化,然后根据 “rem” 进行拆分,这样就会拆分成一个数组 [str1,str2,str3...,str6], 除了最后一个元素,前边的元素都会以 “rem” 样式的数值结尾, 然后在对数组中的元素字符串进行再次根据 “:” 进行…

colab中的变量怎么读取_Fizyr Retinanet在Colab中进行目标检测
colab中的变量怎么读取by RomRoc由RomRoc 带有Fizyr Retinanet的Google Colab中的对象检测 (Object Detection in Google Colab with Fizyr Retinanet) Let’s continue our journey to explore the best machine learning frameworks in computer vision.让我们继续我们的旅程…

c++重载(以运算符重载为主)
重载(OverLoading)是面向对象程序设计多态性的一种体现。所谓重载,是指“同一标识符”在同一作用域的不同场合具有不同的语义,这个标识符可以是函数名或运算符。也就是说,重载可以使多个函数使用同一个函数名ÿ…

记录-MySQL中的事件调度Event Scheduler
下面是自己的实例 /*查询event是否开启(查询结果Off为关闭 On为开启)*/show variables like %sche%; /*开启/关闭命令(1开启--0关闭)*/set global event_scheduler1; /*关闭事件任务: */alter event e_test_insert ON COMPLETION…

JS 实现下载Blod文件
实现代码: //下载Blod文件 const downLoadBlobFile (filename, res) > {if (!res) return;let a document.createElement(a);let blob new Blob([res], { type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charsetutf-8 });let blo…