Returns a list of popular tags and recommended tags for a given URL.
 Popular tags are tags used site-wide for the url; recommended tags
 are drawn from the user's own tags.

 @param [String] url
 @return [Hash<String, Array>]
499539
def suggest(url)
      options = create_params({url: url})
      suggested = self.class.get('/posts/suggest', options)['suggested']
      popular = suggested['popular']
      popular = [] if popular.nil?
      popular = [popular] if popular.class != Array

      recommended = suggested['recommended']
      recommended = [] if recommended.nil?
      recommended = [recommended] if recommended.class != Array

      {:popular => popular, :recommended => recommended}
    end
195100
def url
      @url ||= if @collection.nil?
                 relative_path
               else
                 ::Bunto::URL.new({
                   :template     => @collection.url_template,
                   :placeholders => placeholders,
                 })
               end.to_s.gsub(%r!/$!, "")
    end
700944
def render_hashes(tags, **opts)
      meta_tags.meta_tags.each_key do |property|
        render_hash(tags, property, **opts)
      end
    end
780013
def mentions_erb
      retdict = {
        enabled: @config[:mentions][:enabled],
        top: [],
        nottop: []
      }

      if @config[:mentions][:enabled]
        top = @parsed[:mentions].slice(0, @config[:mentions][:top]) # top X mentions
        top.each do |mention|
          retdict[:top] << mention[1]
        end

        nottop = @parsed[:mentions].slice(@config[:mentions][:top], @config[:mentions][:notop]) # not in the top X
        unless nottop.nil?
          nottop.each do |mention|
            mention[1].delete(:example)
            retdict[:nottop] << mention[1]
          end
        end
      end

      retdict
    end
429967
def _view_url(preference)
      uri = URI(request.url)
      query = Rack::Utils.parse_nested_query(uri.query)
      query["prefer"] = preference
      uri.query = query.to_param
      uri.to_s
    end
57073
def render_icon(tags)
      icon = meta_tags.extract(:icon)
      return unless icon

      # String? Value is an href
      icon = [{ href: icon }] if icon.kind_of?(String)
      # Hash? Single icon instead of a list of icons
      icon = [icon] if icon.kind_of?(Hash)

      icon.each do |icon_params|
        icon_params = { rel: 'icon', type: 'image/x-icon' }.with_indifferent_access.merge(icon_params)
        tags << Tag.new(:link, icon_params)
      end
    end
165077
def url
      @url ||= begin
        base = if @collection.nil?
                 cleaned_relative_path
               else
                 Jekyll::URL.new(
                   :template     => @collection.url_template,
                   :placeholders => placeholders
                 )
               end.to_s.chomp("/")
        base << extname
      end
    end
230556
def get_actual_tag
      supported_tags = @bbtree.current_node[:definition][:supported_tags]

      supported_tags.each do |tag|
        regex_list = @dictionary[tag][:url_matches]

        regex_list.each do |regex|
          return tag if regex =~ @ti.text
        end
      end
      :tag_not_found
    end
431793
def tag_list=(names)
      self.tags = names.split(",").map do |n|
        SimpleTags::Tag.where(name: n.strip).first_or_create!
      end
    end
18717
def get_tag(name)
      tag = nil
      name = name.to_s.downcase
      @tag_name_pairs_cache ||= Hash.new
      return @tag_name_pairs_cache[name] unless @tag_name_pairs_cache[name].nil?
      @elements.each_value do |element|
        next unless element.name.downcase == name
        tag = element.tag
        break
      end
      @tag_name_pairs_cache[name]=tag
      return tag
    end
203566
def _get_tag(self, url, tag, print_warn=True):
        
        # construct complete url
        complete_url = urljoin(self.base_url, url)
        # check if exists
        if requests.get('http:' + complete_url).ok:
            # construct tag
            if tag == 'script':
                return '<script src="{0}"></script>'.format(complete_url)
            elif tag == 'stylesheet':
                return '<link rel="stylesheet" href="{0}">'.format(complete_url)
            else:
                warnings.warn('Given tag is not valid')
        elif print_warn:
            warnings.warn('Url {0} not valid'.format(complete_url))
        return None
1089910
def links
      @links ||= begin
        links = HashWithIndifferentAccess.new
        self.link.each do |link|
          links[link['rel']] = link['href']
        end
        links
      end
    end
1213527
function getUrlVars(string) {
  var vars = [],
    hash,
    hashes,
    str = string.toString();

  if (str.match('&#038;')) {
    str = str.replace("&#038;", "&");
  } else if (str.match('&#38;')) {
    str = str.replace("&#38;", "&");
  } else if (str.match('&amp;')) {
    str = str.replace("&amp;", "&");
  }
  if (str.match('#')) {
    str = str.split('#')[0];
  }
  hashes = str.slice(str.indexOf('?') + 1).split('&');

  for(var i = 0; i < hashes.length; i++) {
    hash = hashes[i].split('=');
    vars.push(hash[0]);
    vars[hash[0]] = hash[1];
  }

  return vars;
}
849597
def render_alternate(tags)
      alternate = meta_tags.extract(:alternate)
      return unless alternate

      if alternate.kind_of?(Hash)
        alternate.each do |hreflang, href|
          tags << Tag.new(:link, rel: 'alternate', href: href, hreflang: hreflang) if href.present?
        end
      elsif alternate.kind_of?(Array)
        alternate.each do |link_params|
          tags << Tag.new(:link, { rel: 'alternate' }.with_indifferent_access.merge(link_params))
        end
      end
    end
199929
def filter_by_tag(issues, newer_tag = nil)
      issues.select do |issue|
        issue["first_occurring_tag"] == (newer_tag.nil? ? nil : newer_tag["name"])
      end
    end
757915
def get_resources(url, resource_class, params={})
      get(url, params).map do |result|
        resource_class.from_hash(result, client: self)
      end
    end
98553
def url_for_page(page)
      view.url_for(view.default_url_options.merge({page_param.to_sym => page}).merge(options[:params] || {}))
    end